diff --git a/.gitignore b/.gitignore
index a39ed2ec..7df723e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -93,3 +93,6 @@ trash
!resources/macOS/MapMap.icns
*.json
+
+# Local development notes
+KNOWN-WARNINGS.txt
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 4530484d..7f713de1 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
## Enforcement
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@mapmap.info. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mapmap@artpluscode.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c2f587d3..a17b5376 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -13,6 +13,14 @@ It really helps us efficiently process your contribution!
[Report a bug](#bug-reports)
[Request a feature](#feature-requests)
[Contribute code](#contributing-code)
+[Coding style](#coding-style)
+[Building](#building)
+[Version numbers](#version-numbers)
+[Files overview](#files-overview)
+[Code management with Git](#code-management-with-git)
+[Make a release](#make-a-release)
+[Project file version number](#project-file-version-number)
+[Qt resources system](#qt-resources-system)
## Report a bug
@@ -44,7 +52,7 @@ We already have a formal [roadmap](https://github.com/mapmapteam/mapmap/wiki/Roa
Feature requests are therefore mostly a way of us discussing/feeling out together where we'd like the project to go.
This can sometimes involve a lot of discussion, as everyone uses MapMap differently. You can join the [MapMap Slack team](https://mapmap.slack.com/) and use the `#feature` channel channel for general questions or discussion about new features
-Feature requests are created as Github Issues, just like bugs.t
+Feature requests are created as Github Issues, just like bugs.
Feature requests are also where code that you or anyone else would like to include in a future pull request is **discussed before being implemented!**
If you're writing code to add a new feature that you think would be awesome to have in the core, that's great!
But please make sure it's been discussed as a feature request _before_ you submit your pull request, as that increases the chances that your pull request will be accepted.
@@ -63,7 +71,7 @@ As with most open source projects, the fastest way to get a feature made is to m
We are more likely to accept your code if we feel like it has been discussed already.
If you are submitting a new feature, it's best if the feature has been discussed beforehand, either as a [feature request](#feature-requests) or on the [Slack](https://mapmap.slack.com/) or the [mailing list](https://listes.koumbit.net/cgi-bin/mailman/listinfo/mapmap-list-mapmap.info).
-- Please read the [code style guidelines](https://github.com/mapmapteam/mapmap/wiki/MapMap-Code-Style) and make sure your code conforms to them.
+- Please read the [coding style](#coding-style) section below and make sure your code conforms to it.
If in doubt, try and match the style and practices you find in the code you are working with.
- Please write _descriptive commit messages_ for each of the commits that you make.
They don't have to be in-depth, just a brief summary of what the commit contains. A page describing how well-written commit messages look like can be found [here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
@@ -88,5 +96,90 @@ This granularity makes the code easier to deal with in cases where some things h
- All pull requests that contain changes that need to be in the changelog **must include relevant additions to `NEWS`**. Use previous entries as a guide for style/indentation/etc.
- In the comments field on your new pull request, enter a description of everything that the code in the pull request does.
- This description is the first contact most of the core team will have with your code, so you should use it to explain why your pull request is awesome and we should accept it.
- - Reference any issues or bugs in the [MapMap issue tracker](github.com/openframeworks/openFrameworks/issues) that are relevant to your pull request using `#issue number` notation, eg to reference issue __1234__ write `#1234`.
+ - Reference any issues or bugs in the [MapMap issue tracker](https://github.com/mapmapteam/mapmap/issues) that are relevant to your pull request using `#issue number` notation, eg to reference issue __1234__ write `#1234`.
- Mention if the code has been tested and on what platform.
+
+## Coding style
+
+* Indent with 2 spaces
+* Opening curly braces on a new line
+* Function and method names camelCase, with lowercase first letter
+* Class names CamelCase
+* Private data members with an underscore as a prefix: `_likeThis`
+* File names all lowercase
+* Always add spaces between operators such as `+`, `-`, `/`, `*`, casts, etc. (except pointers and references)
+
+## Building
+
+See INSTALL.
+
+You will need to install markdown to build some of the documentation that comes with the software.
+
+## Version numbers
+
+We use Semantic Versioning 2.0.0. Given a version number MAJOR.MINOR.PATCH, increment the:
+* MAJOR version when you make incompatible API changes,
+* MINOR version when you add functionality in a backwards-compatible manner, and
+* PATCH version when you make backwards-compatible bug fixes.
+See http://semver.org/
+
+We want the 0 series to be backward-compatible. That means that a project created with MapMap 0.1 should still work with MapMap 0.99, if we ever get to such a version number. When we will break this backward-compatibilty, we will start the 1 series and provide a migration script. This script might be ran from the command-line or on the Web. The other thing we need to be backward-compatible is the OSC interface. The rest of the software can change. This includes the names of the menu items and the appearance of the user interface. We will try to keep these consistent, though.
+
+## Files overview
+
+* CONTRIBUTING.md: What to know to contribute to the project.
+* INSTALL: Instructions to build and install the software.
+* NEWS: Release notes for each tag.
+* README: The short documentation at the root of the project
+* TODO: You can put things to do there, or use https://github.com/mapmapteam/mapmap
+* images/: Images part of the GUI.
+* prototypes/ : Contains prototypes. Please ask the project maintainer before removing some of these.
+* docs/informations/*.md Markdown files to generate the About dialog
+
+## Code management with Git
+
+* We develop in the develop branch. The master branch is only for the latest tag.
+* Create a branch for each new features. Merge it to develop.
+* Create release-x.y.z branch for releases.
+* If possible, avoid merges, and use git rebase instead. (like in the GNOME projects)
+* Create a x.y branch for each x.y major.minor version series.
+* For a new release, merge develop to master (or your branch to the major.minor branch if it's a bugfix release) and then tag it there.
+* In doubt, ask the release manager.
+
+## Make a release
+
+* If it's a new feature, increment minor. If it's bugfix, increment micro. If it's not backward-compatible, increment major.
+* Create a release-x.y.z branch
+* Verify the version number:
+ * vim -o VERSION.txt DMGVERSION.txt mapmap.pro docs/Doxyfile NEWS src/core/MM.cpp
+ * VERSION.txt
+ * VERSION in MM.cpp
+ * VERSION in mapmap.pro
+ * PROJECT_NUMBER in Doxyfile
+* Edit NEWS - update with the news for the release you are about to make
+* Run ./scripts/update-changelog.sh and commit the changes
+* Maybe update the docs/informations/osc.md file and run scripts/update-osc.sh and commit the changes
+* Maybe update the docs/informations/CONTRIBUTORS.md file and run scripts/update-contributors.sh and commit the changes
+* run make
+* run ./sh_build_doc.sh
+* merge to master, or to the major.minor branch
+* run ./sh_make_tarball.sh
+* then untar it, cd to that dir and build the whole thing to see if it works
+* git tag x.y.z
+* go back to your release branch
+* increment micro (or minor) version number in the files above.
+* merge into develop.
+* keep developing.
+
+## Project file version number
+
+* Update its minor number when you introduce new features.
+* Update its major number when it's not backward-compatible anymore with its previous versions.
+* Generally, we should follow the MapMap version, when new changes are introduced. (no need to increment it otherwise)
+
+## Qt resources system
+
+* The mapmap.pro file is where the packaging is done
+* The mapmap.qrc file is where we specify which resources are packaged with the app.
+* Images are set there. They are then available as a path-like alias such as ":/fullscreen"
+* See https://doc.qt.io/qt-6/resources.html
diff --git a/HACKING b/HACKING
deleted file mode 100644
index a7a77c91..00000000
--- a/HACKING
+++ /dev/null
@@ -1,89 +0,0 @@
-Contribute to MapMap
-====================
-
-Build software, doc and the translations
-----------------------------------------
-See INSTALL.
-
-You will need to install markdown to build some of the documentation that comes with the software.
-
-Coding style
-------------
-* indent with 2 spaces
-* opening curly braces on a new line
-* function and method names camelCase, with lowercase first letter
-* class names CamelCase
-* private data members with an underscore as a prefix: _likeThis
-* file names all lowercase
-* always add spaces between operators such as +, -, /, * casts, etc. (except pointers and references)
-
-Version numbers
----------------
-We use Semantic Versioning 2.0.0. Given a version number MAJOR.MINOR.PATCH, increment the:
-* MAJOR version when you make incompatible API changes,
-* MINOR version when you add functionality in a backwards-compatible manner, and
-* PATCH version when you make backwards-compatible bug fixes.
-See http://semver.org/
-
-We want the 0 series to be backward-compatible. That means that a project created with MapMap 0.1 should still work with MapMap 0.99, if we ever get to such a version number. When we will break this backward-compatibilty, we will start the 1 series and provide a migration script. This script might be ran from the command-line or on the Web. The other thing we need to be backward-compatible is the OSC interface. The rest of the software can change. This includes the names of the menu items and the appearance of the user interface. We will try to keep these consistent, though.
-
-Files
------
-* HACKING: What to know to contribute to the project.
-* INSTALL: Instructions to build and install the software.
-* NEWS: Release notes for each tag.
-* README: The short documentation at the root of the project
-* TODO: You can put things to do there, or use https://github.com/mapmapteam/mapmap, or https://www.pivotaltracker.com/s/projects/954570/
-* images/: Images part of the GUI.
-* prototypes/ : Contains prototypes. Please ask the project maintainer before removing some of these.
-* docs/informations/*.md Markdown files to generate the About dialog
-
-Code management with Git
-------------------------
-* We develop in the develop branch. The master branch is only for the latest tag.
-* Create a branch for each new features. Merge it to develop.
-* Create release-x.y.z branch for releases.
-* If possible, avoid merges, and use git rebase instead. (like in the GNOME projects)
-* Create a x.y branch for each x.y major.minor version series.
-* For a new release, merge develop to master (or your branch to the major.minor branch if it's a bugfix release) and then tag it there.
-* In doubt, ask the release manager.
-
-Make a release
---------------
-* If it's a new feature, increment minor. If it's bugfix, increment micro. If it's not backward-compatible, increment major.
-* Create a release-x.y.z branch
-* Verify the version number:
- * vim -o VERSION.txt DMGVERSION.txt mapmap.pro docs/Doxyfile NEWS src/core/MM.cpp
- * VERSION.txt
- * VERSION in MM.cpp
- * VERSION in mapmap.pro
- * PROJECT_NUMBER in Doxyfile
-* Edit NEWS - update with the news for the release you are about to make
-* Run ./scripts/update-changelog.sh and commit the changes
-* Maybe update the docs/informations/osc.md file and run scripts/update-osc.sh and commit the changes
-* Maybe update the docs/informations/CONTRIBUTORS.md file and run scripts/update-contributors.sh and commit the changes
-* run make
-* run ./sh_build_doc.sh
-* merge to master, or to the major.minor branch
-* run ./sh_make_tarball.sh
-* then untar it, cd to that dir and build the whole thing to see if it works
-* git tag x.y.z
-* go back to your release branch
-* increment micro (or minor) version number in the files above.
-* merge into develop.
-* keep developing.
-
-XML file version number
------------------------
-* update its minor number when you introduce new features.
-* update its major number when it's not backward-comptatible anymore with its previous versions
-* generally, we should follow the MapMap version, when new changes are introduced. (no need to increment it otherwise)
-* we will need to implement some fancy XML file version number checking in the future.
-
-Qt resources system
--------------------
-* The mapmap.pro file is where the packaging is done
-* The mapmap.qrc file is where we specify which resources are packaged with the app.
-* Images are set there. They are then available as a path-like alias such as ":/fullscreen"
-* See http://doc.qt.io/qt-5/resources.html
-
diff --git a/README.md b/README.md
index 57423103..e0b9279d 100644
--- a/README.md
+++ b/README.md
@@ -42,9 +42,9 @@ or else the menu will not show.
Authors
-------
-* Sofian Audry: lead developer, user interface designer, project manager.
+* Alexandre Quessy: lead developer, release manager, technical writer, project manager.
+* Sofian Audry: original lead developer, user interface designer, project manager.
* Dame Diongue: developer.
-* Alexandre Quessy: release manager, developer, technical writer, project manager.
* Mike Latona: user interface designer.
* Vasilis Liaskovitis: developer.
diff --git a/docs/informations/CONTRIBUTORS.html b/docs/informations/CONTRIBUTORS.html
index c0dee2ad..5cc00e3a 100644
--- a/docs/informations/CONTRIBUTORS.html
+++ b/docs/informations/CONTRIBUTORS.html
@@ -1,9 +1,9 @@
Authors
-Sofian Audry: lead developer, user interface designer, project manager.
+Alexandre Quessy: lead developer, release manager, technical writer, project manager.
+Sofian Audry: original lead developer, user interface designer, project manager.
Dame Diongue: developer.
-Alexandre Quessy: release manager, developer, technical writer, project manager.
Mike Latona: user interface designer.
Vasilis Liaskovitis: developer.
diff --git a/docs/informations/CONTRIBUTORS.md b/docs/informations/CONTRIBUTORS.md
index e3514666..07c7ca70 100644
--- a/docs/informations/CONTRIBUTORS.md
+++ b/docs/informations/CONTRIBUTORS.md
@@ -1,10 +1,10 @@
## Authors
-- Sofian Audry: lead developer, user interface designer, project
- manager.
-- Dame Diongue: developer.
-- Alexandre Quessy: release manager, developer, technical writer,
+- Alexandre Quessy: lead developer, release manager, technical writer,
+ project manager.
+- Sofian Audry: original lead developer, user interface designer,
project manager.
+- Dame Diongue: developer.
- Mike Latona: user interface designer.
- Vasilis Liaskovitis: developer.
diff --git a/prototypes/blackmagic/composite.sh b/prototypes/blackmagic/composite.sh
deleted file mode 100755
index c8c250c0..00000000
--- a/prototypes/blackmagic/composite.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Using the Blackmagic Intensity Pro
-
-gst-launch -v decklinksrc mode=3 connection=4 ! \
- ffmpegcolorspace ! \
- xvimagesink sync=false
-
diff --git a/prototypes/blackmagic/hdmi-v4l2.sh b/prototypes/blackmagic/hdmi-v4l2.sh
deleted file mode 100755
index 1fcf2aec..00000000
--- a/prototypes/blackmagic/hdmi-v4l2.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-# Using the Blackmagic Intensity Shuttle USB 3.0
-#
-# Download and build: you can download source driver from
-# https://www.blackmagicdesign.com/support - compile a driver from this site
-# for a decklinksink blackmagic card
-# Direct link:
-# https://www.blackmagicdesign.com/support/download/f73ee77fdd384b5286fe86a46d20d045/Linux
-
-GST_DEBUG=2 \
-LANG=C \
-gst-launch-1.0 decklinksrc mode=11 connection=0 audio-input=3 ! \
- video/x-raw,format=UYVY,width=1920,height=1080,framerate=30000/1001,interlace-mode=interleaved ! \
- queue ! xvimagesink
-
-# v4l2sink device=/dev/video1 sync=false
-
-
-# sync=false
-# gst-launch-1.0 -v decklinksrc mode=18 connection=1 ! \
-# videoconvert ! \
-# queue ! \
-# xvimagesink
-#
diff --git a/prototypes/blackmagic/hdmi.sh b/prototypes/blackmagic/hdmi.sh
deleted file mode 100755
index 2964797a..00000000
--- a/prototypes/blackmagic/hdmi.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-# Using the Blackmagic Intensity Shuttle USB 3.0
-#
-# Download and build: you can download source driver from
-# https://www.blackmagicdesign.com/support - compile a driver from this site
-# for a decklinksink blackmagic card
-# Direct link:
-# https://www.blackmagicdesign.com/support/download/f73ee77fdd384b5286fe86a46d20d045/Linux
-
-GST_DEBUG=4 \
-LANG=C \
-gst-launch-1.0 -v decklinksrc mode=18 connection=1 ! \
- videoconvert ! \
- queue ! \
- xvimagesink
-# sync=false
diff --git a/prototypes/blackmagic/s-video.sh b/prototypes/blackmagic/s-video.sh
deleted file mode 100755
index de3e6146..00000000
--- a/prototypes/blackmagic/s-video.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-# Using the Blackmagic Intensity Shuttle USB 3.0
-#
-# Download and build: you can download source driver from
-# https://www.blackmagicdesign.com/support - compile a driver from this site
-# for a decklinksink blackmagic card
-# Direct link:
-# https://www.blackmagicdesign.com/support/download/f73ee77fdd384b5286fe86a46d20d045/Linux
-
-GST_DEBUG=2 \
-LANG=C \
-sudo gst-launch-1.0 -v decklinksrc mode=3 connection=5 ! \
- videoconvert ! \
- xvimagesink
-# sync=false
diff --git a/prototypes/cairo/build.sh b/prototypes/cairo/build.sh
deleted file mode 100755
index e2bb4427..00000000
--- a/prototypes/cairo/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-CFLAGS=`pkg-config --cflags cairo gstreamer-plugins-base-1.0 gstreamer-video-1.0 gstreamer-1.0`
-LDFLAGS=`pkg-config --libs cairo gstreamer-plugins-base-1.0 gstreamer-video-1.0 gstreamer-1.0`
-
-gcc -o cairo-proto -Wall cairo-proto.c ${LDFLAGS} ${CFLAGS}
diff --git a/prototypes/cairo/cairo-proto.c b/prototypes/cairo/cairo-proto.c
deleted file mode 100644
index 9e9f71af..00000000
--- a/prototypes/cairo/cairo-proto.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* GStreamer
- * Copyright (C) 2011 Jon Nordby
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/*
- * Example showing usage of the cairooverlay element
- */
-
-#include
-#include
-
-#include
-#include
-
-#include
-
-
-static gboolean
-on_message (GstBus * bus, GstMessage * message, gpointer user_data)
-{
- GMainLoop *loop = (GMainLoop *) user_data;
-
- switch (GST_MESSAGE_TYPE (message)) {
- case GST_MESSAGE_ERROR:{
- GError *err = NULL;
- gchar *debug;
-
- gst_message_parse_error (message, &err, &debug);
- g_critical ("Got ERROR: %s (%s)", err->message, GST_STR_NULL (debug));
- g_main_loop_quit (loop);
- break;
- }
- case GST_MESSAGE_WARNING:{
- GError *err = NULL;
- gchar *debug;
-
- gst_message_parse_warning (message, &err, &debug);
- g_warning ("Got WARNING: %s (%s)", err->message, GST_STR_NULL (debug));
- g_main_loop_quit (loop);
- break;
- }
- case GST_MESSAGE_EOS:
- g_main_loop_quit (loop);
- break;
- default:
- break;
- }
-
- return TRUE;
-}
-
-/* Datastructure to share the state we are interested in between
- * prepare and render function. */
-typedef struct
-{
- gboolean valid;
- GstVideoInfo vinfo;
-} CairoOverlayState;
-
-/* Store the information from the caps that we are interested in. */
-static void
-prepare_overlay (GstElement * overlay, GstCaps * caps, gpointer user_data)
-{
- CairoOverlayState *state = (CairoOverlayState *) user_data;
-
- state->valid = gst_video_info_from_caps (&state->vinfo, caps);
-}
-
-/* Draw the overlay.
- * This function draws a cute "beating" heart. */
-static void
-draw_overlay (GstElement * overlay, cairo_t * cr, guint64 timestamp,
- guint64 duration, gpointer user_data)
-{
- CairoOverlayState *s = (CairoOverlayState *) user_data;
- double scale;
- int width, height;
-
- if (!s->valid)
- return;
-
- width = GST_VIDEO_INFO_WIDTH (&s->vinfo);
- height = GST_VIDEO_INFO_HEIGHT (&s->vinfo);
-
- scale = 2 * (((timestamp / (int) 1e7) % 70) + 30) / 100.0;
- cairo_translate (cr, width / 2, (height / 2) - 30);
-
- /* FIXME: this assumes a pixel-aspect-ratio of 1/1 */
- cairo_scale (cr, scale, scale);
-
- cairo_move_to (cr, 0, 0);
- cairo_curve_to (cr, 0, -30, -50, -30, -50, 0);
- cairo_curve_to (cr, -50, 30, 0, 35, 0, 60);
- cairo_curve_to (cr, 0, 35, 50, 30, 50, 0);
- cairo_curve_to (cr, 50, -30, 0, -30, 0, 0);
- cairo_set_source_rgba (cr, 0.9, 0.0, 0.1, 0.7);
- cairo_fill (cr);
-}
-
-static GstElement *
-setup_gst_pipeline (CairoOverlayState * overlay_state)
-{
- GstElement *pipeline;
- GstElement *cairo_overlay;
- GstElement *source, *adaptor1, *adaptor2, *sink;
-
- pipeline = gst_pipeline_new ("cairo-overlay-example");
-
- /* Adaptors needed because cairooverlay only supports ARGB data */
- source = gst_element_factory_make ("videotestsrc", "source");
- adaptor1 = gst_element_factory_make ("videoconvert", "adaptor1");
- cairo_overlay = gst_element_factory_make ("cairooverlay", "overlay");
- adaptor2 = gst_element_factory_make ("videoconvert", "adaptor2");
- sink = gst_element_factory_make ("ximagesink", "sink");
- if (sink == NULL)
- sink = gst_element_factory_make ("autovideosink", "sink");
-
- /* If failing, the element could not be created */
- g_assert (cairo_overlay);
-
- /* Hook up the neccesary signals for cairooverlay */
- g_signal_connect (cairo_overlay, "draw",
- G_CALLBACK (draw_overlay), overlay_state);
- g_signal_connect (cairo_overlay, "caps-changed",
- G_CALLBACK (prepare_overlay), overlay_state);
-
- gst_bin_add_many (GST_BIN (pipeline), source, adaptor1,
- cairo_overlay, adaptor2, sink, NULL);
-
- if (!gst_element_link_many (source, adaptor1,
- cairo_overlay, adaptor2, sink, NULL)) {
- g_warning ("Failed to link elements!");
- }
-
- return pipeline;
-}
-
-int
-main (int argc, char **argv)
-{
- GMainLoop *loop;
- GstElement *pipeline;
- GstBus *bus;
- CairoOverlayState *overlay_state;
-
- gst_init (&argc, &argv);
- loop = g_main_loop_new (NULL, FALSE);
-
- /* allocate on heap for pedagogical reasons, makes code easier to transfer */
- overlay_state = g_new0 (CairoOverlayState, 1);
-
- pipeline = setup_gst_pipeline (overlay_state);
-
- bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
- gst_bus_add_signal_watch (bus);
- g_signal_connect (G_OBJECT (bus), "message", G_CALLBACK (on_message), loop);
- gst_object_unref (GST_OBJECT (bus));
-
- gst_element_set_state (pipeline, GST_STATE_PLAYING);
- g_main_loop_run (loop);
-
- gst_element_set_state (pipeline, GST_STATE_NULL);
- gst_object_unref (pipeline);
-
- g_free (overlay_state);
- return 0;
-}
diff --git a/prototypes/controller/controller.h b/prototypes/controller/controller.h
deleted file mode 100644
index cb1bd8ee..00000000
--- a/prototypes/controller/controller.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#include
-#include
-#include "MainWindow.h"
-
-/**
- * Facade to control the application.
- *
- * TODO: implement it.
- * TODO: include it in the project
- * TODO: add signals
- * TODO: the whole app should use actual QObject for properties of everything
- */
-class Controller
-{
- public:
- Controller(MainWindow *owner);
- // CRUD
- bool createObject(const char *objType, std::string &objName);
- bool listObjects(const char *objType, QList &objNames);
- bool destroyObject(const char *objName);
- bool setObjectProperty(const char *objName, const char *propName,
- const QVariantList &value);
- bool getObjectProperty(const char *objName, const char *propName,
- QVariantList &value);
- bool listObjectProperties(const char *objName, QList &values);
- bool saveProject(const char *fileName);
- bool loadProject(const char *fileName);
- bool quit();
- private:
- MainWindow *_owner;
-};
-
-int main(int argc, char **argv)
-{
- /* Example: */
- Controller *controller = new Controller(NULL);
-
- std::string quadName;
- std::string imageName;
-
- controller->createObject("image", imageName);
- controller->createObject("quad", quadName);
- controller->setObjectProperty(sourceName, "uri", QVariant(QString("image.jpg")));
- controller->setObjectProperty(quadName, "source", QVariant(QString(imageName.c_str())));
- controller->setObjectProperty(quadName, "x1", QVariant(3.14159));
- controller->saveProject("project.lmp");
- controller->quit();
-
- delete controller;
- return 0;
-}
diff --git a/prototypes/glfw/Makefile b/prototypes/glfw/Makefile
deleted file mode 100644
index 5c275e4b..00000000
--- a/prototypes/glfw/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-DEPS=glfw3 glu gl
-CC=gcc
-CC_FLAGS=-O0 -g `pkg-config --cflags --libs $(DEPS)` -lSOIL
-EXEC=run
-SOURCES=$(wildcard *.c)
-OBJECTS=$(SOURCES:.c=.o)
-
-all: run
-
-$(EXEC): $(OBJECTS)
- $(CC) $(OBJECTS) $(CC_FLAGS) -o $(EXEC)
-
-%.o: %.c
- $(CC) -c $(CC_FLAGS) $< -o $@
-
-clean:
- rm -f $(EXEC) $(OBJECTS)
-
diff --git a/prototypes/glfw/README b/prototypes/glfw/README
deleted file mode 100644
index 0cc36a2a..00000000
--- a/prototypes/glfw/README
+++ /dev/null
@@ -1 +0,0 @@
-sudo yum install -y SOIL-devel glfw-devel
diff --git a/prototypes/glfw/example.png b/prototypes/glfw/example.png
deleted file mode 100644
index ffb8a2c1..00000000
Binary files a/prototypes/glfw/example.png and /dev/null differ
diff --git a/prototypes/glfw/main.c b/prototypes/glfw/main.c
deleted file mode 100644
index a77e18ae..00000000
--- a/prototypes/glfw/main.c
+++ /dev/null
@@ -1,257 +0,0 @@
-//========================================================================
-// Simple GLFW example
-// Copyright (c) Camilla Berglund
-//
-// This software is provided 'as-is', without any express or implied
-// warranty. In no event will the authors be held liable for any damages
-// arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it
-// freely, subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented; you must not
-// claim that you wrote the original software. If you use this software
-// in a product, an acknowledgment in the product documentation would
-// be appreciated but is not required. //
-// 2. Altered source versions must be plainly marked as such, and must not
-// be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source
-// distribution.
-//
-//========================================================================
-//! [code]
-
-#include
-#include
-#include
-#include
-
-typedef struct _Quad
-{
- int x1;
- int x2;
- int x3;
- int x4;
- int y1;
- int y2;
- int y3;
- int y4;
-} Quad;
-
-static Quad src;
-static Quad dst;
-
-static void error_callback(int error, const char* description)
-{
- fputs(description, stderr);
-}
-
-// static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
-// {
-// if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
-// glfwSetWindowShouldClose(window, GL_TRUE);
-// }
-//
-
-static void
-move_point (int index, int x, int y)
-{
- printf ("move_point (index=%d, x=%d, y=%d)\n", index, x, y);
- switch (index)
- {
- case 1:
- src.x1 += x;
- src.y1 += y;
- break;
- case 2:
- src.x2 += x;
- src.y2 += y;
- break;
- case 3:
- src.x3 += x;
- src.y3 += y;
- break;
- case 4:
- src.x4 += x;
- src.y4 += y;
- break;
- case 5:
- dst.x1 += x;
- dst.y1 += y;
- break;
- case 6:
- dst.x2 += x;
- dst.y2 += y;
- break;
- case 7:
- dst.x3 += x;
- dst.y3 += y;
- break;
- case 8:
- dst.x4 += x;
- dst.y4 += y;
- break;
- }
-}
-
-static void
-key_callback (GLFWwindow *window, int key, int scancode, int action, int mods)
-{
- static int current = 0;
-
- //printf ("key_callback (window=%p, key=%d, scancode=%d, action=%d, mods=%d)\n",
- // window, key, scancode, action, mods);
-
- if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
- glfwSetWindowShouldClose(window, GL_TRUE);
- else if (key == GLFW_KEY_TAB && action == GLFW_PRESS)
- {
- current = (current + 1) % 8;
- printf ("Current = %d\n", current);
- }
- else if (action == GLFW_PRESS || action == GLFW_REPEAT)
- {
- if (key == GLFW_KEY_UP)
- move_point (current + 1, 0, 1);
- else if (key == GLFW_KEY_DOWN)
- move_point (current + 1, 0, -1);
- else if (key == GLFW_KEY_LEFT)
- move_point (current + 1, -1, 0);
- else if (key == GLFW_KEY_RIGHT)
- move_point (current + 1, 1, 0);
- else
- printf ("Unhandled key = %d\n", key);
- }
-}
-
-GLuint load_image (const char *imagepath)
-{
- int width, height;
- GLuint textureID = 0;
-
- unsigned char * data =
- SOIL_load_image(imagepath, &width, &height, 0, SOIL_LOAD_RGB );
- textureID = SOIL_create_OGL_texture (
- data, width, height, 3, textureID, 0);
-
- // TODO: free data?
-
- return textureID;
-}
-
-int main(void)
-{
- GLFWwindow* window;
- GLuint texture;
- const int wrap = 1;
-
- const float image_width = 320;
- const float image_height = 240;
-
- //source
- src.x1 = 0;
- src.y1 = 0;
-
- src.x2 = 320;
- src.y2 = 0;
-
- src.x3 = 320;
- src.y3 = 240;
-
- src.x4 = 0;
- src.y4 = 240;
-
- //destination
- dst.x1 = 0;
- dst.y1 = 0;
-
- dst.x2 = 320;
- dst.y2 = 0;
-
- dst.x3 = 320;
- dst.y3 = 240;
-
- dst.x4 = 0;
- dst.y4 = 240;
-
- glfwSetErrorCallback (error_callback);
-
- if (! glfwInit ())
- exit(EXIT_FAILURE);
-
- window = glfwCreateWindow (640, 480, "MapMap prototype", NULL, NULL);
- if (! window)
- {
- glfwTerminate ();
- exit (EXIT_FAILURE);
- }
-
- glfwMakeContextCurrent (window);
-
- texture = load_image ("example.png");
-
- glfwSetKeyCallback (window, (GLFWkeyfun) key_callback);
-
- while (! glfwWindowShouldClose (window))
- {
- float ratio;
- int width, height;
-
- //glfwGetFramebufferSize(window, &width, &height);
- // XXX aalex I commented the line above and added the two lines below
- width = 640;
- height = 480;
-
- ratio = width / (float) height;
-
- glViewport (0, 0, width, height);
- glClear (GL_COLOR_BUFFER_BIT);
-
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- glOrtho (-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
- glMatrixMode (GL_MODELVIEW);
-
- glLoadIdentity ();
-
- // DRAW THE TEXTURE
- glPushMatrix ();
- glDisable (GL_LIGHTING);
- glColor3f (1, 1, 1);
- glEnable (GL_TEXTURE_2D);
- glBindTexture (GL_TEXTURE_2D, texture);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glBegin (GL_QUADS);
-
- glTexCoord2f (src.x1 / image_width, src.y1 / image_height);
- glVertex3f (dst.x1 / image_width, dst.y1 / image_height, 0);
-
- glTexCoord2f (src.x2 / image_width, src.y2 / image_height);
- glVertex3f (dst.x2 / image_width, dst.y2 / image_height, 0);
-
- glTexCoord2f (src.x3 / image_width, src.y3 / image_height);
- glVertex3f (dst.x3 / image_width, dst.y3 / image_height, 0);
-
- glTexCoord2f (src.x4 / image_width, src.y4 / image_height);
- glVertex3f (dst.x4 / image_width, dst.y4 / image_height, 0);
-
- glEnd ();
- glDisable (GL_TEXTURE_2D);
- glPopMatrix ();
-
- glfwSwapBuffers (window);
- glfwPollEvents ();
- }
-
- glfwDestroyWindow (window);
-
- glfwTerminate ();
- exit (EXIT_SUCCESS);
-}
diff --git a/prototypes/gst/color-balance.sh b/prototypes/gst/color-balance.sh
deleted file mode 100755
index c21d02ed..00000000
--- a/prototypes/gst/color-balance.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# default:
-CONTRAST=1.5
-BRIGHTNESS=0.25
-SATURATION=1.25
-HUE=0.0
-
-# blasted
-# CONTRAST=2.0
-# BRIGHTNESS=1.0
-# SATURATION=2.0
-# HUE=0.0
-
-gst-launch-1.0 videotestsrc ! videobalance contrast=${CONTRAST} brightness=${BRIGHTNESS} saturation=${SATURATION} hue=${HUE} ! videoconvert ! autovideosink
-
-# Valid value for each setting:
-#
-# contrast: [ 0 ~ 2 ] (default = 1)
-# brightness: [ -1~ 1] (default = 0)
-# saturation: [ 0 ~ 2 ] (default = 1)
-# hue: [ -1 ~ 1 ] (default = 0)
diff --git a/prototypes/gtk/Makefile b/prototypes/gtk/Makefile
deleted file mode 100644
index ce7e8159..00000000
--- a/prototypes/gtk/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-DEPS=gtk+-2.0 gtkglext-1.0
-CC=gcc
-CC_FLAGS=-O0 -g `pkg-config --cflags --libs $(DEPS)`
-EXEC=run
-SOURCES=$(wildcard *.c)
-OBJECTS=$(SOURCES:.c=.o)
-
-all: run
-
-$(EXEC): $(OBJECTS)
- $(CC) $(OBJECTS) $(CC_FLAGS) -o $(EXEC)
-
-%.o: %.c
- $(CC) -c $(CC_FLAGS) $< -o $@
-
-clean:
- rm -f $(EXEC) $(OBJECTS)
-
diff --git a/prototypes/gtk/main.c b/prototypes/gtk/main.c
deleted file mode 100644
index 36442112..00000000
--- a/prototypes/gtk/main.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * pixmap.c:
- * Simple off-screen OpenGL rendering example.
- *
- * written by Naofumi Yasufuku
- */
-
-#include
-
-#include
-
-#include
-
-#ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN 1
-#include
-#endif
-
-#ifdef GDK_WINDOWING_QUARTZ
-#include
-#else
-#include
-#include
-#endif
-
-static GdkGLConfig *glconfig = NULL;
-static GdkGLContext *glcontext = NULL;
-static GdkPixmap *pixmap = NULL;
-
-static void
-init (void)
-{
- GLUquadricObj *qobj;
- static GLfloat light_diffuse[] = {1.0, 0.0, 0.0, 1.0};
- static GLfloat light_position[] = {1.0, 1.0, 1.0, 0.0};
-
- qobj = gluNewQuadric ();
- gluQuadricDrawStyle (qobj, GLU_FILL);
- glNewList (1, GL_COMPILE);
- gluSphere (qobj, 1.0, 20, 20);
- glEndList ();
-
- glLightfv (GL_LIGHT0, GL_DIFFUSE, light_diffuse);
- glLightfv (GL_LIGHT0, GL_POSITION, light_position);
- glEnable (GL_LIGHTING);
- glEnable (GL_LIGHT0);
- glEnable (GL_DEPTH_TEST);
-
- glClearColor (1.0, 1.0, 1.0, 1.0);
- glClearDepth (1.0);
-
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- gluPerspective (40.0, 1.0, 1.0, 10.0);
-
- glMatrixMode (GL_MODELVIEW);
- glLoadIdentity ();
- gluLookAt (0.0, 0.0, 3.0,
- 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0);
- glTranslatef (0.0, 0.0, -3.0);
-}
-
-static gboolean
-configure_event (GtkWidget *widget,
- GdkEventConfigure *event,
- gpointer data)
-{
- GtkAllocation allocation;
- GdkGLDrawable *gldrawable;
- static gboolean is_initialized = FALSE;
-
- gtk_widget_get_allocation (widget, &allocation);
-
- /*
- * Create an OpenGL off-screen rendering area.
- */
-
- if (pixmap != NULL)
- g_object_unref (G_OBJECT (pixmap));
-
- pixmap = gdk_pixmap_new (gtk_widget_get_window (widget),
- allocation.width,
- allocation.height,
- -1);
-
- /*
- * Set OpenGL-capability to the pixmap
- */
-
- gldrawable = GDK_GL_DRAWABLE (gdk_pixmap_set_gl_capability (pixmap,
- glconfig,
- NULL));
-
- /*
- * Create OpenGL rendering context (not direct).
- */
-
- if (glcontext == NULL)
- {
- glcontext = gdk_gl_context_new (gldrawable,
- NULL,
- FALSE,
- GDK_GL_RGBA_TYPE);
- if (glcontext == NULL)
- {
- g_print ("Connot create the OpenGL rendering context\n");
- if (gtk_main_level () != 0)
- gtk_main_quit ();
- return TRUE;
- }
-
- g_print ("The OpenGL rendering context is created\n");
- }
-
- /*** OpenGL BEGIN ***/
- if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext))
- return FALSE;
-
- if (!is_initialized)
- {
- init ();
- is_initialized = TRUE;
- }
-
- glViewport (0, 0,
- allocation.width, allocation.height);
-
- glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glCallList (1);
-
- glFlush ();
-
- gdk_gl_drawable_gl_end (gldrawable);
- /*** OpenGL END ***/
-
- return TRUE;
-}
-
-static gboolean
-expose_event (GtkWidget *widget,
- GdkEventExpose *event,
- gpointer data)
-{
- gdk_draw_drawable (gtk_widget_get_window (widget),
- gtk_widget_get_style (widget)->fg_gc[gtk_widget_get_state (widget)],
- pixmap,
- event->area.x, event->area.y,
- event->area.x, event->area.y,
- event->area.width, event->area.height);
-
- return FALSE;
-}
-
-static gboolean
-destroy_gl_context (gpointer data)
-{
- if (glconfig != NULL)
- g_object_unref (G_OBJECT (glconfig));
-
- if (glcontext != NULL)
- g_object_unref (G_OBJECT (glcontext));
-
- return FALSE;
-}
-
-static void
-print_gl_config_attrib (GdkGLConfig *glconfig,
- const gchar *attrib_str,
- int attrib,
- gboolean is_boolean)
-{
- int value;
-
- g_print ("%s = ", attrib_str);
- if (gdk_gl_config_get_attrib (glconfig, attrib, &value))
- {
- if (is_boolean)
- g_print ("%s\n", value == TRUE ? "TRUE" : "FALSE");
- else
- g_print ("%d\n", value);
- }
- else
- g_print ("*** Cannot get %s attribute value\n", attrib_str);
-}
-
-static void
-examine_gl_config_attrib (GdkGLConfig *glconfig)
-{
- g_print ("\nOpenGL visual configurations :\n\n");
-
- g_print ("gdk_gl_config_is_rgba (glconfig) = %s\n",
- gdk_gl_config_is_rgba (glconfig) ? "TRUE" : "FALSE");
- g_print ("gdk_gl_config_is_double_buffered (glconfig) = %s\n",
- gdk_gl_config_is_double_buffered (glconfig) ? "TRUE" : "FALSE");
- g_print ("gdk_gl_config_is_stereo (glconfig) = %s\n",
- gdk_gl_config_is_stereo (glconfig) ? "TRUE" : "FALSE");
- g_print ("gdk_gl_config_has_alpha (glconfig) = %s\n",
- gdk_gl_config_has_alpha (glconfig) ? "TRUE" : "FALSE");
- g_print ("gdk_gl_config_has_depth_buffer (glconfig) = %s\n",
- gdk_gl_config_has_depth_buffer (glconfig) ? "TRUE" : "FALSE");
- g_print ("gdk_gl_config_has_stencil_buffer (glconfig) = %s\n",
- gdk_gl_config_has_stencil_buffer (glconfig) ? "TRUE" : "FALSE");
- g_print ("gdk_gl_config_has_accum_buffer (glconfig) = %s\n",
- gdk_gl_config_has_accum_buffer (glconfig) ? "TRUE" : "FALSE");
-
- g_print ("\n");
-
- print_gl_config_attrib (glconfig, "GDK_GL_USE_GL", GDK_GL_USE_GL, TRUE);
- print_gl_config_attrib (glconfig, "GDK_GL_BUFFER_SIZE", GDK_GL_BUFFER_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_LEVEL", GDK_GL_LEVEL, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_RGBA", GDK_GL_RGBA, TRUE);
- print_gl_config_attrib (glconfig, "GDK_GL_DOUBLEBUFFER", GDK_GL_DOUBLEBUFFER, TRUE);
- print_gl_config_attrib (glconfig, "GDK_GL_STEREO", GDK_GL_STEREO, TRUE);
- print_gl_config_attrib (glconfig, "GDK_GL_AUX_BUFFERS", GDK_GL_AUX_BUFFERS, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_RED_SIZE", GDK_GL_RED_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_GREEN_SIZE", GDK_GL_GREEN_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_BLUE_SIZE", GDK_GL_BLUE_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_ALPHA_SIZE", GDK_GL_ALPHA_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_DEPTH_SIZE", GDK_GL_DEPTH_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_STENCIL_SIZE", GDK_GL_STENCIL_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_ACCUM_RED_SIZE", GDK_GL_ACCUM_RED_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_ACCUM_GREEN_SIZE", GDK_GL_ACCUM_GREEN_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_ACCUM_BLUE_SIZE", GDK_GL_ACCUM_BLUE_SIZE, FALSE);
- print_gl_config_attrib (glconfig, "GDK_GL_ACCUM_ALPHA_SIZE", GDK_GL_ACCUM_ALPHA_SIZE, FALSE);
-
- g_print ("\n");
-}
-
-int
-main (int argc,
- char *argv[])
-{
- gint major, minor;
-
- GtkWidget *window;
- GtkWidget *vbox;
- GtkWidget *drawing_area;
- GtkWidget *button;
-
- /*
- * Init GTK.
- */
-
- gtk_init (&argc, &argv);
-
- /*
- * Init GtkGLExt.
- */
-
- gtk_gl_init (&argc, &argv);
-
- /*
- * Query OpenGL extension version.
- */
-
- gdk_gl_query_version (&major, &minor);
- g_print ("\nOpenGL extension version - %d.%d\n",
- major, minor);
-
- /*
- * Configure OpenGL-capable visual.
- */
-
- /* Try single-buffered visual */
- glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGB |
- GDK_GL_MODE_DEPTH |
- GDK_GL_MODE_SINGLE);
- if (glconfig == NULL)
- {
- g_print ("*** No appropriate OpenGL-capable visual found.\n");
- exit (1);
- }
-
- examine_gl_config_attrib (glconfig);
-
- /*
- * Top-level window.
- */
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (window), "pixmap");
-
- /*
- * If window manager doesn't watch the WM_COLORMAP_WINDOWS property on
- * the top-level window, we have to set OpenGL window's colormap to the
- * top-level window.
- */
- gtk_widget_set_colormap (window,
- gdk_gl_config_get_colormap (glconfig));
-
- g_signal_connect (G_OBJECT (window), "delete_event",
- G_CALLBACK (gtk_main_quit), NULL);
-
- /*
- * VBox.
- */
-
- vbox = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (window), vbox);
- gtk_widget_show (vbox);
-
- /*
- * Drawing area for drawing OpenGL scene.
- */
-
- drawing_area = gtk_drawing_area_new ();
- gtk_widget_set_size_request (drawing_area, 200, 200);
-
- /* Set OpenGL-capable colormap. */
- gtk_widget_set_colormap (drawing_area,
- gdk_gl_config_get_colormap (glconfig));
-
- g_signal_connect (G_OBJECT (drawing_area), "configure_event",
- G_CALLBACK (configure_event), NULL);
- g_signal_connect (G_OBJECT (drawing_area), "expose_event",
- G_CALLBACK (expose_event), NULL);
-
- gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
-
- gtk_widget_show (drawing_area);
-
- /*
- * Simple quit button.
- */
-
- button = gtk_button_new_with_label ("Quit");
-
- g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (gtk_main_quit), NULL);
-
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-
- gtk_widget_show (button);
-
- /*
- * Show window.
- */
-
- gtk_widget_show (window);
-
- /*
- * Main loop.
- */
-
- /* Destroy the GLX context explicitly when application is terminated. */
- gtk_quit_add (0, (GtkFunction) destroy_gl_context, NULL);
-
- gtk_main ();
-
- return 0;
-}
diff --git a/prototypes/properties/README b/prototypes/properties/README
deleted file mode 100644
index 18e16616..00000000
--- a/prototypes/properties/README
+++ /dev/null
@@ -1,2 +0,0 @@
-Doesn't work yet, but that is how properties work in Qt4.
-
diff --git a/prototypes/properties/build.sh b/prototypes/properties/build.sh
deleted file mode 100755
index c8d77916..00000000
--- a/prototypes/properties/build.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# qt4-default qt4-qmake
-qmake-qt4
-make
diff --git a/prototypes/properties/hello.pro b/prototypes/properties/hello.pro
deleted file mode 100644
index 31f56c8a..00000000
--- a/prototypes/properties/hello.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-CONFIG += qt debug
-TEMPLATE = app
-HEADERS =
-SOURCES = main.cpp
-QT += gui
-RESOURCES =
-
-docs.depends = $(HEADERS) $(SOURCES)
-docs.commands = (cat Doxyfile; echo "INPUT = $?") | doxygen -
-QMAKE_EXTRA_TARGETS += docs
-
diff --git a/prototypes/properties/main.cpp b/prototypes/properties/main.cpp
deleted file mode 100644
index 433871d0..00000000
--- a/prototypes/properties/main.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-#include
-#include
-#include
-#include
-
-class MyClass : public QObject
- {
- Q_OBJECT
- Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged)
- Q_ENUMS(Priority)
- Q_CLASSINFO("Version", "3.0.0")
- public:
- MyClass() {}
- //MyClass(QObject *parent = 0);
- ~MyClass();
-
- enum Priority { High, Low, VeryHigh, VeryLow };
-
- void setPriority(Priority priority)
- {
- m_priority = priority;
- emit priorityChanged(priority);
- }
- Priority priority() const
- { return m_priority; }
-
- signals:
- void priorityChanged(Priority);
-
- private:
- Priority m_priority;
- };
-
-
-void MyClass::priorityChanged(Priority)
-{
- // pass
-}
-void dump (QObject *object)
-{
- std::cout << "object: " << std::endl;
- const QMetaObject *metaobject = object->metaObject();
- int count = metaobject->propertyCount();
- for (int i=0; iproperty(i);
- const char *name = metaproperty.name();
- QVariant value = object->property(name);
- std::cout << " * " << name << " = " << value.toString().toStdString() << std::endl;
- }
-}
-
-int main(int /* argc */, char ** /* argv */)
-{
- MyClass *myinstance = new MyClass();
- //QObject *object = myinstance;
-
- myinstance->setPriority(MyClass::VeryHigh);
- //object->setProperty("priority", "VeryHigh");
-
- dump ((QObject *) myinstance);
-
- delete myinstance;
-
- return 0;
-}
diff --git a/prototypes/sdl/Makefile b/prototypes/sdl/Makefile
deleted file mode 100644
index 65bae740..00000000
--- a/prototypes/sdl/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-DEPS=sdl gl glu SDL_image
-CC=gcc
-CC_FLAGS=-O0 -g `pkg-config --cflags --libs $(DEPS)`
-EXEC=run
-SOURCES=$(wildcard *.c)
-OBJECTS=$(SOURCES:.c=.o)
-
-all: run
-
-$(EXEC): $(OBJECTS)
- $(CC) $(OBJECTS) $(CC_FLAGS) -o $(EXEC)
-
-%.o: %.c
- $(CC) -c $(CC_FLAGS) $< -o $@
-
-clean:
- rm -f $(EXEC) $(OBJECTS)
-
diff --git a/prototypes/sdl/README b/prototypes/sdl/README
deleted file mode 100644
index 6a3fe519..00000000
--- a/prototypes/sdl/README
+++ /dev/null
@@ -1 +0,0 @@
-sudo yum install -y SDL_image-devel
diff --git a/prototypes/sdl/example.png b/prototypes/sdl/example.png
deleted file mode 100644
index ffb8a2c1..00000000
Binary files a/prototypes/sdl/example.png and /dev/null differ
diff --git a/prototypes/sdl/main.c b/prototypes/sdl/main.c
deleted file mode 100644
index 8d13bfa4..00000000
--- a/prototypes/sdl/main.c
+++ /dev/null
@@ -1,370 +0,0 @@
-#include "SDL.h"
-#include "SDL_opengl.h"
-#include "SDL_image.h"
-
-#include
-#include
-#include
-
-#define WIDTH 640
-#define HEIGHT 480
-
-static const char * IMAGE_FILE = "example.png";
-
-GLfloat yaw;
-GLfloat pitch;
-int level;
-
-static void
-subdivide (GLfloat point0[3], GLfloat point1[3], GLfloat point2[3], int level)
-{
- int coord;
- GLfloat midpoint[3][3];
-
- /* Don't subdivide any further; just draw the triangle */
- if (level==0)
- {
- glColor3fv (point0);
- glVertex3fv (point0);
- glColor3fv (point1);
- glVertex3fv (point1);
- glColor3fv (point2);
- glVertex3fv (point2);
- return;
- }
-
- /* Calculate a midpoint on each edge of the triangle */
- for (coord = 0; coord<3; coord++)
- {
- midpoint[0][coord] = (point0[coord] + point1[coord])*0.5;
- midpoint[1][coord] = (point1[coord] + point2[coord])*0.5;
- midpoint[2][coord] = (point2[coord] + point0[coord])*0.5;
- }
-
- /* Subdivide each triangle into three more */ /* . */
- level--; /* /X\ */
- subdivide (point0,midpoint[0],midpoint[2],level); /* /xxx\ */
- subdivide (point1,midpoint[1],midpoint[0],level); /* /X\ /X\ */
- subdivide (point2,midpoint[2],midpoint[1],level); /* /XXXVXXX\ */
-}
-
-static void
-paint_triangles ()
-{
- int i;
-
- /* Coordinates of the 6 vertices of the octahedron */
- static GLfloat point[6][3] = {
- {1.0f,0.0f,0.0f},{-1.0f,0.0f,0.0f},
- {0.0f,1.0f,0.0f},{0.0f,-1.0f,0.0f},
- {0.0f,0.0f,1.0f},{0.0f,0.0f,-1.0f}
- };
-
- /* indices of the vertices of the triangles which make up each of
- * the 8 faces of the octahedron */
- static int triangle[8][3] = {
- {2,4,0},{2,0,5},{2,5,1},{2,1,4},{3,0,4},{3,5,0},{3,1,5},{3,4,1}
- };
-
- /* Rotate the object */
- glRotatef (pitch, 1.0f, 0.0f, 0.0f);
- glRotatef (yaw, 0.0f, 1.0f, 0.0f);
-
- /* Draw the triangles which make up the object */
- glBegin (GL_TRIANGLES);
-
- for (i=0; i<8; i++)
- {
- subdivide (point[triangle[i][0]],point[triangle[i][1]],point[triangle[i][2]],level);
- }
-
- glEnd ();
-
- /* increment the rotation every frame */
- yaw = yaw + 0.05;
-}
-
-static void
-paint_begin ()
-{
- /* Clear the color plane and the z-buffer */
- glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glLoadIdentity ();
-
- /* Move the object 2 units away from the camera */
- glTranslatef (0.0f, 0.0f, -2.0f);
-}
-
-
-static void
-paint_end ()
-{
- /* finally, swap the back and front buffers */
- SDL_GL_SwapBuffers ();
-}
-
-static void
-setup_sdl ()
-{
- const SDL_VideoInfo* video;
- int img_flags;
- int img_initted;
-
- if (SDL_Init (SDL_INIT_VIDEO) < 0 )
- {
- fprintf (stderr, "Couldn't initialize SDL: %s\n", SDL_GetError ());
- exit (1);
- }
-
- /* Quit SDL properly on exit */
- atexit (SDL_Quit);
-
- /* Get the current video information */
- video = SDL_GetVideoInfo ( );
- if ( video == NULL )
- {
- fprintf (stderr, "Couldn't get video information: %s\n", SDL_GetError ());
- exit (1);
- }
-
- /* Set the minimum requirements for the OpenGL window */
- SDL_GL_SetAttribute ( SDL_GL_RED_SIZE, 5 );
- SDL_GL_SetAttribute ( SDL_GL_GREEN_SIZE, 5 );
- SDL_GL_SetAttribute ( SDL_GL_BLUE_SIZE, 5 );
- SDL_GL_SetAttribute ( SDL_GL_DEPTH_SIZE, 16 );
- SDL_GL_SetAttribute ( SDL_GL_DOUBLEBUFFER, 1 );
-
- /* Note the SDL_DOUBLEBUF flag is not required to enable double
- * buffering when setting an OpenGL video mode.
- * Double buffering is enabled or disabled using the
- * SDL_GL_DOUBLEBUFFER attribute.
- */
- if ( SDL_SetVideoMode ( WIDTH, HEIGHT, video->vfmt->BitsPerPixel, SDL_OPENGL ) == 0 )
- {
- fprintf (stderr, "Couldn't set video mode: %s\n", SDL_GetError ());
- exit (1);
- }
-
- img_flags = IMG_INIT_JPG | IMG_INIT_PNG;
- img_initted = IMG_Init (img_flags);
- if (img_initted & img_flags != img_flags)
- {
- printf ("IMG_Init: Failed to init required jpg and png support!\n");
- printf ("IMG_Init: %s\n", IMG_GetError ());
- exit (1);
- }
-}
-
-static void
-setup_opengl ()
-{
- float aspect = (float)WIDTH / (float)HEIGHT;
-
- /* Make the viewport cover the whole window */
- glViewport (0, 0, WIDTH, HEIGHT);
-
- /* Set the camera projection matrix:
- * field of view: 90 degrees
- * near clipping plane at 0.1
- * far clipping plane at 100.0
- */
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
-
- gluPerspective (60.0, aspect, 0.1, 100.0);
- /* We're done with the camera, now matrix operations
- * will affect the modelview matrix
- * */
- glMatrixMode (GL_MODELVIEW);
-
- /* set the clear color to gray */
- glClearColor (0.5, 0.5 ,0.5, 0);
-
- /* We want z-buffer tests enabled*/
- glEnable (GL_DEPTH_TEST);
-
- /* Do draw back-facing polygons*/
- glDisable (GL_CULL_FACE);
-}
-
-static void
-EnableTransparency ()
-{
- glEnable (GL_BLEND);
- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-}
-
-static GLuint
-LoadTexture(const char *filename, int *textw, int *texth)
-{
- SDL_Surface *surface;
- GLuint textureid;
- int mode;
-
- surface = IMG_Load (filename);
-
- // Or if you don't use SDL_image you can use SDL_LoadBMP here instead:
- // surface = SDL_LoadBMP(filename);
-
- // could not load filename
- if (! surface)
- {
- return 0;
- }
-
- // work out what format to tell glTexImage2D to use...
- if (surface->format->BytesPerPixel == 3)
- { // RGB 24bit
- mode = GL_RGB;
- }
- else if (surface->format->BytesPerPixel == 4)
- { // RGBA 32bit
- mode = GL_RGBA;
- }
- else
- {
- SDL_FreeSurface (surface);
- return 0;
- }
-
- *textw = surface->w;
- *texth = surface->h;
- // create one texture name
- glGenTextures (1, &textureid);
-
- // tell opengl to use the generated texture name
- glBindTexture (GL_TEXTURE_2D, textureid);
-
- // this reads from the sdl surface and puts it into an opengl texture
- glTexImage2D (GL_TEXTURE_2D, 0, mode, surface->w, surface->h, 0, mode, GL_UNSIGNED_BYTE, surface->pixels);
-
- // these affect how this texture is drawn later on...
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- // clean up
- SDL_FreeSurface (surface);
-
- printf ("Loaded image %s %dx%d\n", filename, *textw, *texth);
-
- return textureid;
-}
-
-static void
-DrawTexture(int x, int y, GLuint textureid, int textw, int texth)
-{
- // tell opengl to use the generated texture name
- glBindTexture (GL_TEXTURE_2D, textureid);
- glEnable (GL_TEXTURE_2D);
-
- // make a rectangle
- glBegin (GL_QUADS);
-
- // top left
- glTexCoord2i (0, 0);
- glVertex3f (x, y, 0);
-
- // top right
- glTexCoord2i (1, 0);
- glVertex3f (x + textw, y, 0);
-
- // bottom right
- glTexCoord2i (1, 1);
- glVertex3f (x + textw, y + texth, 0);
-
- // bottom left
- glTexCoord2i (0, 1);
- glVertex3f (x, y + texth, 0);
-
- glEnd ();
-
- glDisable (GL_TEXTURE_2D );
-}
-
-static void
-main_loop ()
-{
- SDL_Event event;
-
- GLuint texture;
- int textw, texth;
-
- printf ("Loading texture %s\n", IMAGE_FILE);
- texture = LoadTexture (IMAGE_FILE, &textw, &texth);
-
- while (1)
- {
- /* process pending events */
- while (SDL_PollEvent (&event))
- {
- switch (event.type)
- {
- case SDL_KEYDOWN:
- switch (event.key.keysym.sym)
- {
- case SDLK_ESCAPE:
- exit (0);
- break;
-
- case SDLK_KP_PLUS:
- level++;
- if (level > 5)
- level=5;
- break;
-
- case SDLK_KP_MINUS:
- level--;
- if (level < 0)
- level=0;
- break;
-
- default:
- //no default key processing
- // (stops compiler warnings for unhandled SDL keydefs
- break;
- }
- break;
-
- case SDL_MOUSEMOTION:
- pitch += event.motion.yrel;
- if (pitch < -70)
- pitch = -70;
- if (pitch > 70)
- pitch = 70;
- break;
-
- case SDL_QUIT:
- exit (0);
- break;
- }
- }
-
- /* update the screen */
- paint_begin ();
- paint_triangles ();
- glColor3f (1.0, 1.0, 1.0);
- DrawTexture (0, 0, texture, textw, texth);
- paint_end ();
-
- /* Wait 50ms to avoid using up all the CPU time */
- SDL_Delay (50);
- }
-}
-
-
-int
-main (int argc, char* argv[])
-{
- setup_sdl ();
-
- setup_opengl ();
-
- yaw = 45;
- pitch = 0;
- level = 2;
-
- main_loop ();
-
- return 0;
-}
diff --git a/prototypes/sh-osx-gst-test.sh b/prototypes/sh-osx-gst-test.sh
deleted file mode 100755
index 9405310b..00000000
--- a/prototypes/sh-osx-gst-test.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o verbose
-#export GST_PLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries
-export LANG=C
-# export GST_DEBUG=3
-#FILEPATH=/Users/aalex/Desktop/mapmap-videos/BonneFete.mov
-FILEPATH=/Users/aalex/Downloads/sintel_trailer-480p.ogv
-
-gst-launch-0.10 uridecodebin uri=file://${FILEPATH} ! ffmpegcolorspace ! autovideosink
-
diff --git a/prototypes/shm/read.sh b/prototypes/shm/read.sh
deleted file mode 100755
index 46806fb3..00000000
--- a/prototypes/shm/read.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-gst-launch-0.10 -e shmsrc socket-path=/tmp/test is-live=1 ! \
- video/x-raw-yuv,format=\(fourcc\)I420,framerate=30/1,width=640,height=480 ! \
- xvimagesink
-
-
diff --git a/prototypes/shm/write.sh b/prototypes/shm/write.sh
deleted file mode 100755
index 14b1f667..00000000
--- a/prototypes/shm/write.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-gst-launch-0.10 -v videotestsrc ! \
- 'video/x-raw-yuv, width=640, height=480, framerate=30/1, format=(fourcc)I420' ! \
- shmsink socket-path=/tmp/test shm-size=10000000 wait-for-connection=0
-
-
diff --git a/prototypes/wx/wx-01-simple/build.sh b/prototypes/wx/wx-01-simple/build.sh
deleted file mode 100755
index 91a8fec9..00000000
--- a/prototypes/wx/wx-01-simple/build.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-# libwxgtk2.8-dev
-g++ main.cpp -o run `wx-config --libs --cxxflags --gl-libs` -lglut -lGL -lSOIL -I/usr/include
diff --git a/prototypes/wx/wx-01-simple/example.png b/prototypes/wx/wx-01-simple/example.png
deleted file mode 100644
index ffb8a2c1..00000000
Binary files a/prototypes/wx/wx-01-simple/example.png and /dev/null differ
diff --git a/prototypes/wx/wx-01-simple/main.cpp b/prototypes/wx/wx-01-simple/main.cpp
deleted file mode 100644
index 7de3b8bc..00000000
--- a/prototypes/wx/wx-01-simple/main.cpp
+++ /dev/null
@@ -1,373 +0,0 @@
-// NOTE: To run, it is recommended not to be in Compiz or Beryl, they have shown some instability.
-// Needs: libwxgtk2.8-dev libsoil-dev
-// g++ main.cpp -o run `wx-config --libs --cxxflags --gl-libs` -lSOIL
-
-#include
-#include
-#include
-#include
-#include
-
-#ifndef WIN32
-#include // FIXME: ¿This work/necessary in Windows?
- //Not necessary, but if it was, it needs to be replaced by process.h AND io.h
-#endif
-
-typedef struct _Quad
-{
- int x1;
- int x2;
- int x3;
- int x4;
- int y1;
- int y2;
- int y3;
- int y4;
-} Quad;
-
-static void
-move_point (Quad *src, Quad *dst, int index, int x, int y)
-{
- printf ("move_point (index=%d, x=%d, y=%d)\n", index, x, y);
- switch (index)
- {
- case 1:
- src->x1 += x;
- src->y1 += y;
- break;
- case 2:
- src->x2 += x;
- src->y2 += y;
- break;
- case 3:
- src->x3 += x;
- src->y3 += y;
- break;
- case 4:
- src->x4 += x;
- src->y4 += y;
- break;
- case 5:
- dst->x1 += x;
- dst->y1 += y;
- break;
- case 6:
- dst->x2 += x;
- dst->y2 += y;
- break;
- case 7:
- dst->x3 += x;
- dst->y3 += y;
- break;
- case 8:
- dst->x4 += x;
- dst->y4 += y;
- break;
- }
-}
-
-GLuint load_image (const char *imagepath, float *image_width, float *image_height)
-{
- int width, height;
- GLuint textureID = 0;
-
- unsigned char * data =
- SOIL_load_image(imagepath, &width, &height, 0, SOIL_LOAD_RGB );
- textureID = SOIL_create_OGL_texture (
- data, width, height, 3, textureID, 0);
-
- // TODO: free data?
-
- (* image_width) = width;
- (* image_height) = height;
-
- return textureID;
-}
-
-class wxGLCanvasSubClass: public wxGLCanvas
-{
- void Render();
- public:
- wxGLCanvasSubClass(wxFrame* parent);
- void Paintit(wxPaintEvent& event);
- void movePoint(int index, int x, int y);
- protected:
- DECLARE_EVENT_TABLE()
- private:
- GLuint texture;
- float image_width;
- float image_height;
- Quad src;
- Quad dst;
-
- void OnChar(wxKeyEvent & event);
-
- void OnMouseEvent(wxMouseEvent& event);
- void setup_texture();
-};
-
-BEGIN_EVENT_TABLE(wxGLCanvasSubClass, wxGLCanvas)
- EVT_PAINT (wxGLCanvasSubClass::Paintit)
- EVT_KEY_DOWN (wxGLCanvasSubClass::OnChar)
- EVT_MOUSE_EVENTS(wxGLCanvasSubClass::OnMouseEvent)
-// EVT_ENTER_WINDOW(wxGLCanvasSubClass::OnMouseEnter)
-END_EVENT_TABLE()
-
-wxGLCanvasSubClass::wxGLCanvasSubClass(wxFrame *parent)
-:wxGLCanvas(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, wxT("GLCanvas"))
-{
- int argc = 1;
- char* argv[1] = { wxString((wxTheApp->argv)[0]).char_str() };
-}
-
-void wxGLCanvasSubClass::Paintit(wxPaintEvent& WXUNUSED(event))
-{
- Render();
-}
-
-void wxGLCanvasSubClass::OnChar(wxKeyEvent & event)
-{
- static int current = 0;
- printf("hello");
- switch (event.GetKeyCode())
- {
- case WXK_TAB:
- current = (current + 1) % 8;
- printf ("Current = %d\n", current);
- break;
- case WXK_UP:
- move_point (&src, &dst, current + 1, 0, 1);
- break;
- case WXK_DOWN:
- move_point (&src, &dst, current + 1, 0, -1);
- break;
- case WXK_LEFT:
- move_point (&src, &dst, current + 1, -1, 0);
- break;
- case WXK_RIGHT:
- move_point (&src, &dst, current + 1, 1, 0);
- break;
- default:
- printf ("Unhandled key");
- break;
- }
- Render();
-}
-
-void wxGLCanvasSubClass::OnMouseEvent(wxMouseEvent& event)
-{
- printf("x=%d y=%d LeftIsDown=%d\n", event.GetX(), event.GetY(), (int)event.LeftIsDown());
- SetFocus();
-}
-
-void wxGLCanvasSubClass::setup_texture()
-{
- texture = load_image ("example.png", &image_width, &image_height);
-
- //source
- src.x1 = 0;
- src.y1 = 0;
-
- src.x2 = 320;
- src.y2 = 0;
-
- src.x3 = 320;
- src.y3 = 240;
-
- src.x4 = 0;
- src.y4 = 240;
-
- //destination
- dst.x1 = -320;
- dst.y1 = -240;
-
- dst.x2 = 0;
- dst.y2 = -240;
-
- dst.x3 = 0;
- dst.y3 = 0;
-
- dst.x4 = -320;
- dst.y4 = 0; // 240;
-}
-
-void wxGLCanvasSubClass::Render()
-{
- static bool texture_is_set = false;
- float ratio;
-
- SetCurrent();
- wxPaintDC dc(this);
-
- if (! texture_is_set)
- {
- this->setup_texture();
- texture_is_set = true;
- }
- ratio = (float) GetSize().x / (float) GetSize().y;
-
- glClearColor(0, 0, 0, 0);
- glClear(GL_COLOR_BUFFER_BIT);
-// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glViewport(0, 0, (GLint) GetSize().x, (GLint) GetSize().y);
-
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- glOrtho (-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
- glMatrixMode (GL_MODELVIEW);
-
- glLoadIdentity ();
-
- // Now, draw
- // DRAW THE TEXTURE
- glPushMatrix ();
-
- // Enable blending mode (for alphas).
- glEnable (GL_BLEND);
- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
-
- glDisable (GL_LIGHTING);
- glEnable (GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, texture);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
-
- // Draw source texture (not moving).
- glColor4f (1, 1, 1, 0.5f);
- glBegin (GL_QUADS);
- {
- glTexCoord2f (0, 0);
- glVertex3f (0, 0, 0);
-
- glTexCoord2f (1, 0);
- glVertex3f (1, 0, 0);
-
- glTexCoord2f (1, 1);
- glVertex3f (1, 1, 0);
-
- glTexCoord2f (0, 1);
- glVertex3f (0, 1, 0);
- }
- glEnd ();
-
- // Project source texture and sent it to destination.
- glColor4f (1, 1, 1, 1.0f);
- glBegin (GL_QUADS);
- {
- glTexCoord2f (src.x1 / image_width, src.y1 / image_height);
- glVertex3f (dst.x1 / image_width, dst.y1 / image_height, 0);
-
- glTexCoord2f (src.x2 / image_width, src.y2 / image_height);
- glVertex3f (dst.x2 / image_width, dst.y2 / image_height, 0);
-
- glTexCoord2f (src.x3 / image_width, src.y3 / image_height);
- glVertex3f (dst.x3 / image_width, dst.y3 / image_height, 0);
-
- glTexCoord2f (src.x4 / image_width, src.y4 / image_height);
- glVertex3f (dst.x4 / image_width, dst.y4 / image_height, 0);
- }
- glEnd ();
-
- glDisable(GL_TEXTURE_2D);
-
- glColor4f (1, 1, 1, 1);
-
- // Source quad.
- glLineWidth(5);
- glBegin (GL_LINE_STRIP);
- {
- glVertex3f(src.x1 / image_width, src.y1 / image_height, 0);
- glVertex3f(src.x2 / image_width, src.y2 / image_height, 0);
- glVertex3f(src.x3 / image_width, src.y3 / image_height, 0);
- glVertex3f(src.x4 / image_width, src.y4 / image_height, 0);
- glVertex3f(src.x1 / image_width, src.y1 / image_height, 0);
- }
- glEnd ();
-
- glColor4f (1, 0, 0, 1);
-
- // Destination quad.
- glBegin (GL_LINE_STRIP);
- {
- glVertex3f(dst.x1 / image_width, dst.y1 / image_height, 0);
- glVertex3f(dst.x2 / image_width, dst.y2 / image_height, 0);
- glVertex3f(dst.x3 / image_width, dst.y3 / image_height, 0);
- glVertex3f(dst.x4 / image_width, dst.y4 / image_height, 0);
- glVertex3f(dst.x1 / image_width, dst.y1 / image_height, 0);
- }
- glEnd ();
-
- glDisable (GL_TEXTURE_2D);
- glPopMatrix ();
-
- // Done drawing
-
- glFlush();
- SwapBuffers();
-}
-
-void wxGLCanvasSubClass::movePoint(int index, int x, int y)
-{
- move_point (&src, &dst, index, x, y);
-}
-
-class MyApp: public wxApp
-{
- private:
- virtual bool OnInit();
- wxGLCanvasSubClass * MyGLCanvas;
- int FilterEvent(wxEvent& event);
-};
-
-int MyApp::FilterEvent(wxEvent& event)
-{
- static int current = 0;
- if ((event.GetEventType() == wxEVT_KEY_DOWN))
- {
- switch (((wxKeyEvent&)event).GetKeyCode())
- {
- case WXK_TAB:
- current = (current + 1) % 8;
- printf ("Current = %d\n", current);
- return true;
- break;
- case WXK_UP:
- MyGLCanvas->movePoint(current + 1, 0, 1);
- return true;
- break;
- case WXK_DOWN:
- MyGLCanvas->movePoint(current + 1, 0, -1);
- return true;
- break;
- case WXK_LEFT:
- MyGLCanvas->movePoint(current + 1, -1, 0);
- return true;
- break;
- case WXK_RIGHT:
- MyGLCanvas->movePoint(current + 1, 1, 0);
- return true;
- break;
- default:
- printf ("Unhandled key");
- break;
- }
- }
- return -1;
-}
-
-IMPLEMENT_APP(MyApp)
-
-bool MyApp::OnInit()
-{
- wxFrame *frame = new wxFrame((wxFrame *) NULL, -1, wxT("Hello GL World"), wxPoint(50, 50), wxSize(640, 480));
- MyGLCanvas = new wxGLCanvasSubClass(frame);
-
-// frame->SetWindowStyle(wxWANTS_CHARS);
- frame->Show(TRUE);
- return TRUE;
-}
diff --git a/prototypes/wx/wx-02-input-output/Common.cpp b/prototypes/wx/wx-02-input-output/Common.cpp
deleted file mode 100644
index 8f6ee49f..00000000
--- a/prototypes/wx/wx-02-input-output/Common.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Common.cpp
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 "Common.h"
-
-std::tr1::shared_ptr Common::currentMapping;
-std::tr1::shared_ptr Common::currentMapper;
-
-void Common::initializeLibremapper(int frameWidth, int frameHeight) {
- Image* img = new Image("example.png");
-
- float centerX = frameWidth / 2;
- float centerY = frameHeight / 2;
- float textureHalfWidth = img->getWidth() / 2;
- float textureHalfHeight = img->getHeight() / 2;
-// printf("Common: %f %f %f %f\n", centerX, centerY, textureHalfWidth, textureHalfHeight);
-
- TextureMapping* tm = new TextureMapping(
- img,
-
- // Destination.
- new Quad(Point(centerX-textureHalfWidth, centerY-textureHalfHeight),
- Point(centerX+textureHalfWidth, centerY-textureHalfHeight),
- Point(centerX+textureHalfWidth, centerY+textureHalfHeight),
- Point(centerX-textureHalfWidth, centerY+textureHalfHeight)),
-
- // Input.
- new Quad(Point(centerX-textureHalfWidth, centerY-textureHalfHeight),
- Point(centerX+textureHalfWidth, centerY-textureHalfHeight),
- Point(centerX+textureHalfWidth, centerY+textureHalfHeight),
- Point(centerX-textureHalfWidth, centerY+textureHalfHeight))
- );
- Common::currentMapping.reset( tm );
- Common::currentMapper.reset( new QuadTextureMapper( tm ) );
-}
-
diff --git a/prototypes/wx/wx-02-input-output/Common.h b/prototypes/wx/wx-02-input-output/Common.h
deleted file mode 100644
index ede3e08d..00000000
--- a/prototypes/wx/wx-02-input-output/Common.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Common.h
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 COMMON_H_
-#define COMMON_H_
-
-#include
-
-#include "Paint.h"
-#include "Shape.h"
-#include "Mapper.h"
-
-class Common {
-public:
- static std::tr1::shared_ptr currentMapping;
- static std::tr1::shared_ptr currentMapper;
-
- static void initializeLibremapper(int frameWidth, int frameHeight);
-};
-
-#endif /* COMMON_H_ */
diff --git a/prototypes/wx/wx-02-input-output/DestinationGLCanvas.cpp b/prototypes/wx/wx-02-input-output/DestinationGLCanvas.cpp
deleted file mode 100644
index 5b32167a..00000000
--- a/prototypes/wx/wx-02-input-output/DestinationGLCanvas.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DestinationGLCanvas.cpp
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 "DestinationGLCanvas.h"
-
-DestinationGLCanvas::DestinationGLCanvas(wxFrame *parent) :
- MapperGLCanvas(parent) {
-// int argc = 1;
-// char* argv[1] = { wxString((wxTheApp ->argv)[0]).char_str() };
-}
-
-void DestinationGLCanvas::doRender() {
- // TODO: Ceci est un hack necessaire car tout est en fonction de la width/height de la texture.
- // Il faut changer ca.
- std::tr1::shared_ptr textureMapping = std::tr1::static_pointer_cast(Common::currentMapping);
- wxASSERT(textureMapping != NULL);
-
- std::tr1::shared_ptr texture = std::tr1::static_pointer_cast(textureMapping->getPaint());
- wxASSERT(texture != NULL);
-
- if (texture->getTextureId() == 0)
- {
- texture->loadTexture();
- texture->setPosition( (GetClientSize().x - texture->getWidth()) / 2,
- (GetClientSize().y - texture->getHeight()) / 2 );
- }
-
- // Now, draw
- // DRAW THE TEXTURE
- glPushMatrix();
-
- // Draw the mapping.
- Common::currentMapper->draw();
-
- // Draw the quad.
- Quad& quad = getQuad();
-
- glColor4f(1, 0, 0, 1);
-
- // Destination quad.
- // Source quad.
- glLineWidth(5);
- glBegin (GL_LINE_STRIP);
- {
- for (int i=0; i<5; i++) {
- glVertex3f(quad.getVertex(i % 4).x,
- quad.getVertex(i % 4).y,
- 0);
- }
- }
- glEnd ();
-
- glPopMatrix();
-}
-
diff --git a/prototypes/wx/wx-02-input-output/DestinationGLCanvas.h b/prototypes/wx/wx-02-input-output/DestinationGLCanvas.h
deleted file mode 100644
index e6681767..00000000
--- a/prototypes/wx/wx-02-input-output/DestinationGLCanvas.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * DestinationGLCanvas.h
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 DESTINATIONGLCANVAS_H_
-#define DESTINATIONGLCANVAS_H_
-
-#include
-#include
-#include
-#include
-#include
-
-#include "MapperGLCanvas.h"
-
-class DestinationGLCanvas: public MapperGLCanvas {
-public:
- DestinationGLCanvas(wxFrame* parent);
-
- virtual Quad& getQuad() {
- std::tr1::shared_ptr textureMapping = std::tr1::static_pointer_cast(Common::currentMapping);
- wxASSERT(textureMapping != NULL);
-
- std::tr1::shared_ptr quad = std::tr1::static_pointer_cast(Common::currentMapping->getShape());
- wxASSERT(quad != NULL);
-
- return (*quad);
- }
-
-private:
- virtual void doRender();
-};
-
-#endif /* DESTINATIONGLCANVAS_H_ */
diff --git a/prototypes/wx/wx-02-input-output/Mapper.h b/prototypes/wx/wx-02-input-output/Mapper.h
deleted file mode 100644
index a4fb31d1..00000000
--- a/prototypes/wx/wx-02-input-output/Mapper.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Mapper.h
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 MAPPER_H_
-#define MAPPER_H_
-
-#include "Shape.h"
-#include "Paint.h"
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-class Mapping
-{
-protected:
- std::tr1::shared_ptr _paint;
- std::tr1::shared_ptr _shape;
-
-public:
- Mapping(Paint* paint, Shape* shape)
- : _paint(paint), _shape(shape)
- {}
-
- virtual void build() {
- _paint->build();
- _shape->build();
- }
-
-public:
- std::tr1::shared_ptr getPaint() const { return _paint; }
- std::tr1::shared_ptr getShape() const { return _shape; }
-};
-
-class TextureMapping : public Mapping
-{
-private:
- std::tr1::shared_ptr _inputShape;
-
-public:
- TextureMapping(Paint* paint,
- Shape* shape,
- Shape* inputShape)
- : Mapping(paint, shape),
- _inputShape(inputShape)
- {}
-
- virtual void build() {
- Mapping::build();
- _inputShape->build();
- }
-public:
- std::tr1::shared_ptr getInputShape() const { return _inputShape; }
-};
-
-class Mapper
-{
-protected:
- std::tr1::shared_ptr _mapping;
- Mapper(Mapping* mapping) : _mapping(mapping) {}
- virtual ~Mapper() {}
-
-public:
- virtual void draw() = 0;
-};
-
-//class ShapeDrawer
-//{
-//protected:
-// std:tr1::shared_ptr _shape;
-//
-//public:
-// ShapeDrawer(const std:tr1::shared_ptr& shape) : _shape(shape) {}
-// virtual ~ShapeDrawer() {}
-//
-// virtual void draw() = 0;
-//};
-//
-//class QuadDrawer
-//{
-//public:
-// QuadDrawer(const std:tr1::shared_ptr& quad) : ShapeDrawer(quad) {}
-//
-// virtual void draw() {
-// std::tr1::shared_ptr quad = std::tr1::static_pointer_cast(_shape);
-// wxASSERT(quad != NULL);
-//
-// glColor4f (1, 1, 1, 1);
-//
-// // Source quad.
-// glLineWidth(5);
-// glBegin (GL_LINE_STRIP);
-// {
-// for (int i=0; i<5; i++) {
-// glVertex3f(quad->getVertex(i % 4).x / (GLfloat)texture->getWidth(),
-// quad->getVertex(i % 4).y / (GLfloat)texture->getHeight(),
-// 0);
-// }
-// }
-// glEnd ();
-// }
-//};
-
-class QuadTextureMapper : public Mapper
-{
-public:
- QuadTextureMapper(TextureMapping* mapping) : Mapper(mapping) {}
- virtual ~QuadTextureMapper() {}
-
- virtual void draw() {
- std::tr1::shared_ptr textureMapping = std::tr1::static_pointer_cast(_mapping);
- wxASSERT(textureMapping != NULL);
-
- std::tr1::shared_ptr texture = std::tr1::static_pointer_cast(textureMapping->getPaint());
- wxASSERT(texture != NULL);
-
- std::tr1::shared_ptr quad = std::tr1::static_pointer_cast(textureMapping->getShape());
- wxASSERT(quad != NULL);
-
- std::tr1::shared_ptr inputQuad = std::tr1::static_pointer_cast(textureMapping->getInputShape());
- wxASSERT(inputQuad != NULL);
-
- printf("Texid: %d\n", texture->getTextureId());
- // Project source texture and sent it to destination.
-
- glEnable (GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, texture->getTextureId());
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glColor4f(1, 1, 1, 1.0f);
- glBegin(GL_QUADS);
- {
- for (int i=0; i<4; i++)
- {
- glTexCoord2f( ( inputQuad->getVertex(i).x - texture->getX() ) / (GLfloat) texture->getWidth(),
- ( inputQuad->getVertex(i).y - texture->getY() ) / (GLfloat) texture->getHeight());
- glVertex3f( quad->getVertex(i).x,
- quad->getVertex(i).y,
- 0);
- }
- }
- glEnd();
-
- glDisable(GL_TEXTURE_2D);
- }
-};
-
-
-#endif /* MAPPER_H_ */
diff --git a/prototypes/wx/wx-02-input-output/MapperGLCanvas.cpp b/prototypes/wx/wx-02-input-output/MapperGLCanvas.cpp
deleted file mode 100644
index 5142d69f..00000000
--- a/prototypes/wx/wx-02-input-output/MapperGLCanvas.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * MapperGLCanvas.cpp
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 "MapperGLCanvas.h"
-
-wxGLContext* MapperGLCanvas::sharedContext = 0;
-
-BEGIN_EVENT_TABLE (MapperGLCanvas, wxGLCanvas)
- EVT_PAINT (MapperGLCanvas::Paintit)
- EVT_KEY_DOWN (MapperGLCanvas::OnChar)
- EVT_MOUSE_EVENTS(MapperGLCanvas::OnMouseEvent)
-// EVT_ENTER_WINDOW(MapperGLCanvas::OnMouseEnter)
-END_EVENT_TABLE()
-
-
-MapperGLCanvas::MapperGLCanvas(wxFrame *parent) :
- wxGLCanvas(parent, sharedContext, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0,
- wxT("GLCanvas")) {
- if (!sharedContext) {
- sharedContext = GetContext();
- }
- // int argc = 1;
- // char* argv[1] = { wxString((wxTheApp ->argv)[0]).char_str() };
-}
-
-void MapperGLCanvas::Paintit(wxPaintEvent& WXUNUSED(event)) {
- GetParent()->Refresh();
- Render();
-}
-
-void MapperGLCanvas::OnChar(wxKeyEvent & event) {
- static int current = 0;
- int xMove = 0;
- int yMove = 0;
- switch (event.GetKeyCode()) {
- case WXK_TAB:
- current = (current + 1) % 4;
- break;
- case WXK_UP:
- yMove = -1;
- break;
- case WXK_DOWN:
- yMove = +1;
- break;
- case WXK_LEFT:
- xMove = -1;
- break;
- case WXK_RIGHT:
- xMove = +1;
- break;
- default:
- printf("Unhandled key");
- break;
- }
-
- Quad& quad = getQuad();
- Point p = quad.getVertex(current);
- p.x += xMove;
- p.y += yMove;
- quad.setVertex(current, p);
-
- Render();
-}
-
-void MapperGLCanvas::OnMouseEvent(wxMouseEvent& event) {
- printf("x=%d y=%d LeftIsDown=%d\n", event.GetX(), event.GetY(),
- (int) event.LeftIsDown());
- SetFocus();
-}
-
-void MapperGLCanvas::Render() {
- if (!sharedContext) {
- sharedContext = GetContext();
- }
- SetCurrent(*sharedContext);
- wxPaintDC dc(this);
-
- enterRender();
- doRender();
- exitRender();
-}
-
-void MapperGLCanvas::enterRender() {
-
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
- glViewport(0, 0, (GLint) GetSize().x, (GLint) GetSize().y);
-
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- glOrtho (
- 0.0f, (float) GetSize().x, // left, right
- (float) GetSize().y, 0.0f, // bottom, top
- -1.0, 1.0f);
- glMatrixMode (GL_MODELVIEW);
-// glLoadIdentity (); // FIXME? is this needed here?
-}
-
-void MapperGLCanvas::exitRender() {
- glFlush();
- SwapBuffers();
-}
-
-
diff --git a/prototypes/wx/wx-02-input-output/MapperGLCanvas.h b/prototypes/wx/wx-02-input-output/MapperGLCanvas.h
deleted file mode 100644
index 46351f55..00000000
--- a/prototypes/wx/wx-02-input-output/MapperGLCanvas.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * MapperGLCanvas.h
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 MAPPERGLCANVAS_H_
-#define MAPPERGLCANVAS_H_
-
-#include
-#include
-
-#include "Common.h"
-#include "Shape.h"
-
-class MapperGLCanvas: public wxGLCanvas {
-private:
- static wxGLContext* sharedContext;
-
-public:
- MapperGLCanvas(wxFrame* parent);
- virtual ~MapperGLCanvas() {}
-
- virtual void Paintit(wxPaintEvent& event);
-
- virtual Quad& getQuad() = 0;
-
-protected:
- DECLARE_EVENT_TABLE()
-
- virtual void Render();
- virtual void enterRender();
- virtual void doRender() = 0;
- virtual void exitRender();
-
-private:
- virtual void OnChar(wxKeyEvent& event);
- virtual void OnMouseEvent(wxMouseEvent& event);
-
-};
-
-#endif /* MAPPERGLCANVAS_H_ */
diff --git a/prototypes/wx/wx-02-input-output/Paint.h b/prototypes/wx/wx-02-input-output/Paint.h
deleted file mode 100644
index 377cde11..00000000
--- a/prototypes/wx/wx-02-input-output/Paint.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Paint.h
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 PAINT_H_
-#define PAINT_H_
-
-#include
-#include
-#include
-
-class Paint
-{
-protected:
- Paint() {}
-public:
- virtual ~Paint() {}
- virtual void build() {}
-};
-
-class Texture : public Paint
-{
-protected:
- GLuint textureId;
- int x;
- int y;
-
- Texture(GLuint textureId_=0) : textureId(textureId_) {}
- virtual ~Texture() {}
-
-public:
- GLuint getTextureId() const { return textureId; }
- virtual void loadTexture() = 0;
- virtual int getWidth() const = 0;
- virtual int getHeight() const = 0;
-
- virtual void setPosition(int xPos, int yPos) {
- x = xPos;
- y = yPos;
- }
- virtual int getX() const { return x; }
- virtual int getY() const { return y; }
-};
-
-class Image : public Texture
-{
-protected:
- std::string imagePath;
- int width;
- int height;
- int x;
- int y;
- unsigned char* imageData;
-
-public:
- Image(const std::string imagePath_) : Texture(), imagePath(imagePath_), width(-1), height(-1), x(-1), y(-1) {
- imageData = SOIL_load_image(imagePath.c_str(), &width, &height, 0, SOIL_LOAD_RGB );
- wxASSERT(imageData);
- }
- virtual ~Image() {}
-
- virtual void loadTexture() {
- textureId = SOIL_create_OGL_texture ( imageData, width, height, 3, textureId, 0);
- // TODO: free data?
- }
-
- virtual void build() {
- }
-
- virtual int getWidth() const { return width; }
- virtual int getHeight() const { return height; }
-
-
-};
-
-#endif /* PAINT_H_ */
diff --git a/prototypes/wx/wx-02-input-output/Shape.h b/prototypes/wx/wx-02-input-output/Shape.h
deleted file mode 100644
index 279e2352..00000000
--- a/prototypes/wx/wx-02-input-output/Shape.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Shape.h
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 SHAPE_H_
-#define SHAPE_H_
-
-#include
-#include
-
-struct Point
-{
- double x;
- double y;
- Point(double x_, double y_) : x(x_), y(y_) {}
-};
-
-class Shape
-{
-public:
- std::vector vertices;
- Shape() {}
- Shape(std::vector vertices_) : vertices(vertices_) {}
- virtual ~Shape() {}
-
- virtual void build() {}
-
- const Point& getVertex(int i) { return vertices[i]; }
- void setVertex(int i, Point v) { vertices[i] = v; }
- void setVertex(int i, double x, double y)
- {
- vertices[i].x = x;
- vertices[i].y = y;
- }
-};
-
-class Quad : public Shape
-{
-public:
- Quad() {}
- Quad(Point p1, Point p2, Point p3, Point p4) {
- vertices.push_back(p1);
- vertices.push_back(p2);
- vertices.push_back(p3);
- vertices.push_back(p4);
- }
- virtual ~Quad() {}
-};
-
-#endif /* SHAPE_H_ */
diff --git a/prototypes/wx/wx-02-input-output/SourceGLCanvas.cpp b/prototypes/wx/wx-02-input-output/SourceGLCanvas.cpp
deleted file mode 100644
index 6ccd03a8..00000000
--- a/prototypes/wx/wx-02-input-output/SourceGLCanvas.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * SourceGLCanvas.cpp
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 "SourceGLCanvas.h"
-
-SourceGLCanvas::SourceGLCanvas(wxFrame *parent) :
- MapperGLCanvas(parent) {
-// int argc = 1;
-// char* argv[1] = { wxString((wxTheApp ->argv)[0]).char_str() };
-}
-
-void SourceGLCanvas::doRender() {
- // TODO: Ceci est un hack necessaire car tout est en fonction de la width/height de la texture.
- // Il faut changer ca.
- std::tr1::shared_ptr textureMapping = std::tr1::static_pointer_cast(Common::currentMapping);
- wxASSERT(textureMapping != NULL);
-
- std::tr1::shared_ptr texture = std::tr1::static_pointer_cast(textureMapping->getPaint());
- wxASSERT(texture != NULL);
-
- if (texture->getTextureId() == 0) {
- texture->loadTexture();
- texture->setPosition( (GetClientSize().x - texture->getWidth()) / 2,
- (GetClientSize().y - texture->getHeight()) / 2 );
- }
- // Now, draw
- // DRAW THE TEXTURE
- glPushMatrix();
-
- // Enable blending mode (for alphas).
- glEnable (GL_BLEND);
- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- glDisable (GL_LIGHTING);
- glEnable (GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, texture->getTextureId());
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- // TODO: Exact projection of texture
- // see http://stackoverflow.com/questions/15242507/perspective-correct-texturing-of-trapezoid-in-opengl-es-2-0
-
- // Draw source texture (not moving) in the center of the area.
-
- float centerX = GetClientSize().x / 2;
- float centerY = GetClientSize().y / 2;
- float textureHalfWidth = texture->getWidth() / 2;
- float textureHalfHeight = texture->getHeight() / 2;
-
- //printf("SRC: %f %f %f %f\n", centerX, centerY, textureHalfWidth, textureHalfHeight);
- glColor4f (1, 1, 1, 1.0f);
- glBegin (GL_QUADS);
- {
- glTexCoord2f (0, 0);
- glVertex3f (texture->getX(), texture->getY(), 0);
-
- glTexCoord2f (1, 0);
- glVertex3f (texture->getX()+texture->getWidth(), texture->getY(), 0);
-
- glTexCoord2f (1, 1);
- glVertex3f (texture->getX()+texture->getWidth(), texture->getY()+texture->getHeight(), 0);
-
- glTexCoord2f (0, 1);
- glVertex3f (texture->getX(), texture->getY()+texture->getHeight(), 0);
- }
- glEnd ();
-
- glDisable(GL_TEXTURE_2D);
-
- // Draw the quad.
- Quad& quad = getQuad();
-
- glColor4f(1, 0, 0, 1);
-
- // Source quad.
- // Source quad.
- glLineWidth(5);
- glBegin (GL_LINE_STRIP);
- {
- for (int i=0; i<5; i++) {
- glVertex3f(quad.getVertex(i % 4).x,
- quad.getVertex(i % 4).y,
- 0);
- }
- }
- glEnd ();
-
- glPopMatrix();
-}
-
diff --git a/prototypes/wx/wx-02-input-output/SourceGLCanvas.h b/prototypes/wx/wx-02-input-output/SourceGLCanvas.h
deleted file mode 100644
index 270bec03..00000000
--- a/prototypes/wx/wx-02-input-output/SourceGLCanvas.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * SourceGLCanvas.h
- *
- * (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
- *
- * 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 3 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 SOURCEGLCANVAS_H_
-#define SOURCEGLCANVAS_H_
-
-#include
-#include
-#include
-#include
-#include
-
-#include "MapperGLCanvas.h"
-
-class SourceGLCanvas: public MapperGLCanvas {
-public:
- SourceGLCanvas(wxFrame* parent);
-
- virtual Quad& getQuad() {
- std::tr1::shared_ptr textureMapping = std::tr1::static_pointer_cast(Common::currentMapping);
- wxASSERT(textureMapping != NULL);
-
- std::tr1::shared_ptr inputQuad = std::tr1::static_pointer_cast(textureMapping->getInputShape());
- wxASSERT(inputQuad != NULL);
-
- return (*inputQuad);
- }
-
-private:
- virtual void doRender();
-};
-
-
-#endif /* DESTINATIONGLCANVAS_H_ */
diff --git a/prototypes/wx/wx-02-input-output/build.sh b/prototypes/wx/wx-02-input-output/build.sh
deleted file mode 100755
index 1f32ba81..00000000
--- a/prototypes/wx/wx-02-input-output/build.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-# libwxgtk2.8-dev
-g++ main.cpp Common.cpp DestinationGLCanvas.cpp SourceGLCanvas.cpp MapperGLCanvas.cpp -o run `wx-config --libs --cxxflags --gl-libs` -lglut -lGL -lSOIL -I/usr/include
diff --git a/prototypes/wx/wx-02-input-output/example.png b/prototypes/wx/wx-02-input-output/example.png
deleted file mode 100644
index ffb8a2c1..00000000
Binary files a/prototypes/wx/wx-02-input-output/example.png and /dev/null differ
diff --git a/prototypes/wx/wx-02-input-output/main.cpp b/prototypes/wx/wx-02-input-output/main.cpp
deleted file mode 100644
index 10c89b40..00000000
--- a/prototypes/wx/wx-02-input-output/main.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// NOTE: To run, it is recommended not to be in Compiz or Beryl, they have shown some instability.
-
-#include
-#include "Common.h"
-#include "DestinationGLCanvas.h"
-#include "SourceGLCanvas.h"
-
-#include
-#include
-
-#ifndef WIN32
-#include // FIXME: ¿This work/necessary in Windows?
- //Not necessary, but if it was, it needs to be replaced by process.h AND io.h
-#endif
-
-class MyApp: public wxApp
-{
- virtual bool OnInit();
- SourceGLCanvas * sourceCanvas;
- DestinationGLCanvas * destinationCanvas;
-//public:
-// int FilterEvent(wxEvent& event);
-};
-
-IMPLEMENT_APP(MyApp)
-
-bool MyApp::OnInit()
-{
- wxFrame *frame = new wxFrame((wxFrame *) NULL, -1, wxT("Libremapping"), wxPoint(50, 50), wxSize(640, 480));
-
- wxBoxSizer* topSizer = new wxBoxSizer( wxHORIZONTAL );
- sourceCanvas = new SourceGLCanvas(frame);
- destinationCanvas = new DestinationGLCanvas(frame);
-
- topSizer->Add(sourceCanvas, 1, wxEXPAND);
- topSizer->AddSpacer(10);
- topSizer->Add(destinationCanvas, 1, wxEXPAND);
-
-// frame->SetWindowStyle(wxWANTS_CHARS);
- frame->SetSizer(topSizer);
-
- // HACK: values 320x480 should be retrieved automatically
- Common::initializeLibremapper(320, 480);
-
- frame->Show(TRUE);
-
-
-
- return TRUE;
-}
-//
-//int MyApp::FilterEvent(wxEvent& event) {
-// printf("Event: %d %d\n", event.GetEventType(), wxEVT_KEY_DOWN);
-//
-// if (event.GetEventType() == wxEVT_CHAR) {
-// printf("Char: %d\n", ((wxKeyEvent&)event).GetKeyCode());
-// return true;
-// }
-//
-// return -1;
-//}
-//
-
diff --git a/prototypes/wx/wx-03-polyline/build.sh b/prototypes/wx/wx-03-polyline/build.sh
deleted file mode 100755
index e778f155..00000000
--- a/prototypes/wx/wx-03-polyline/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -o verbose
-
-# libwxgtk2.8-dev
-g++ main.cpp -o run `wx-config --libs --cxxflags --gl-libs` -lGL -lGLU -lglut
-
-# g++ main.cpp -o run -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -lwx_gtk2u_gl-2.8 -L/usr/lib/x86_64-linux-gnu -pthread -Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8
diff --git a/prototypes/wx/wx-03-polyline/main.cpp b/prototypes/wx/wx-03-polyline/main.cpp
deleted file mode 100644
index 424c0940..00000000
--- a/prototypes/wx/wx-03-polyline/main.cpp
+++ /dev/null
@@ -1,369 +0,0 @@
-// NOTE: To run, it is recommended not to be in Compiz or Beryl, they have shown some instability.
-// Needs: libwxgtk2.8-dev
-// g++ main.cpp -o run `wx-config --libs --cxxflags --gl-libs`
-
-#include
-#include
-#include
-#include
-#include
-
-#ifndef WIN32
-#include // FIXME: ¿This work/necessary in Windows?
- //Not necessary, but if it was, it needs to be replaced by process.h AND io.h
-#endif
-
-typedef enum
-{
- LINES = 0,
- POLYGON = 1
-} Style;
-
-/*
- * Left: place point
- * Right: remove previous point
- * Middle: invisible line. (no line)
- */
-class Point
-{
- public:
- Point(float x, float y)
- {
- this->x = x;
- this->y = y;
- }
- float x;
- float y;
-};
-
-class PolyLine
-{
- public:
- void addPoint(Point point);
- void removeLastPoint();
- void clear();
- void draw();
- unsigned int size();
- void setStyle(Style style);
- private:
- std::vector points;
- Style style;
-};
-
-void PolyLine::setStyle(Style style)
-{
- this->style = style;
-}
-
-unsigned int PolyLine::size()
-{
- return points.size();
-}
-
-void PolyLine::addPoint(Point point)
-{
- points.push_back(point);
-}
-
-void PolyLine::removeLastPoint()
-{
- if (points.size() >= 1)
- points.erase(points.end());
-}
-void PolyLine::clear()
-{
- points.clear();
-}
-
-void PolyLine::draw()
-{
- std::vector::const_iterator iter;
-
- glPushMatrix ();
- if (style == LINES)
- glBegin (GL_LINE_STRIP);
- else if (style == POLYGON)
- glBegin (GL_POLYGON);
- for (iter = points.begin(); iter != points.end(); iter++)
- glVertex3f ((*iter).x, (*iter).y, 0.0f);
- glEnd ();
- glPopMatrix ();
-}
-
-class Manager
-{
- public:
- void addPoint(Point point);
- void addPolyLine(Point point);
- void removeLastPoint();
- void draw();
- void clear();
- void setStyle(Style style);
- Style getStyle();
- private:
- std::vector lines;
- unsigned int current;
- Style style;
-};
-
-void Manager::setStyle(Style style)
-{
- this->style = style;
-}
-
-Style Manager::getStyle()
-{
- return style;
-}
-
-void Manager::addPoint(Point point)
-{
- if (lines.size() == 0)
- {
- lines.push_back(PolyLine());
- current = 0;
- }
- lines[current].addPoint(point);
-}
-
-void Manager::addPolyLine(Point point)
-{
- lines.push_back(PolyLine());
- current++;
- lines[current].addPoint(point);
-}
-
-void Manager::removeLastPoint()
-{
- // TODO: return bool
- if (lines.size() > 0)
- {
- if (lines[current].size() == 0)
- if (current == 0)
- lines.clear();
- else
- {
- lines.erase(lines.end());
- current--;
- }
- else
- lines[current].removeLastPoint();
- }
-}
-
-void Manager::draw()
-{
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
- glDisable (GL_TEXTURE_2D);
- glEnable(GL_LINE_SMOOTH);
- glLineWidth(3.0f);
- glDisable (GL_LIGHTING);
- glColor3f (0.2f, 1.0f, 0.2f);
-
- std::vector::iterator iter;
- for (iter = lines.begin(); iter != lines.end(); iter++)
- {
- (*iter).setStyle(style);
- (*iter).draw();
- }
-}
-
-void Manager::clear()
-{
- lines.clear();
-}
-
-void draw_marquee(float x, float y)
-{
- const int length = 30;
- const int distance = 10;
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
- glDisable (GL_TEXTURE_2D);
- glEnable(GL_LINE_SMOOTH);
- glLineWidth(3.0f);
- glDisable (GL_LIGHTING);
- glColor3f (1.0f, 0.0f, 0.0f);
-
- glBegin(GL_LINES);
- glVertex3f(x - (length + distance), y, 0.0f);
- glVertex3f(x - distance, y, 0.0f);
- glEnd();
-
- glBegin(GL_LINES);
- glVertex3f(x + (length + distance), y, 0.0f);
- glVertex3f(x + distance, y, 0.0f);
- glEnd();
-
- glBegin(GL_LINES);
- glVertex3f(x, y - (length + distance), 0.0f);
- glVertex3f(x, y - distance, 0.0f);
- glEnd();
-
- glBegin(GL_LINES);
- glVertex3f(x, y + (length + distance), 0.0f);
- glVertex3f(x, y + distance, 0.0f);
- glEnd();
-}
-
-class MyCanvas: public wxGLCanvas
-{
- void Render();
- public:
- MyCanvas(wxFrame* parent);
- void evt_paint_cb(wxPaintEvent& event);
- protected:
- DECLARE_EVENT_TABLE()
- private:
- void evt_mouse_events_cb (wxMouseEvent& event);
- void evt_key_down_cb (wxKeyEvent& event);
- void setup_polyline ();
- Manager manager;
- float mousex;
- float mousey;
-};
-
-BEGIN_EVENT_TABLE(MyCanvas, wxGLCanvas)
- EVT_PAINT (MyCanvas::evt_paint_cb)
- EVT_KEY_DOWN (MyCanvas::evt_key_down_cb)
- EVT_MOUSE_EVENTS(MyCanvas::evt_mouse_events_cb)
-END_EVENT_TABLE()
-
-MyCanvas::MyCanvas(wxFrame *parent)
-:wxGLCanvas(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, wxT("GLCanvas"))
-{
- int argc = 1;
- char* argv[1] = { wxString((wxTheApp->argv)[0]).char_str() };
-}
-
-void MyCanvas::evt_paint_cb(wxPaintEvent& WXUNUSED(event))
-{
- Render();
-}
-
-void MyCanvas::evt_mouse_events_cb(wxMouseEvent& event)
-{
- //printf("x=%d y=%d LeftIsDown=%d\n", event.GetX(), event.GetY(), (int) event.LeftIsDown());
- bool should_render = false;
- Point point = Point(mousex, mousey);
- mousex = (float) event.GetX();
- mousey = (float) event.GetY();
-
- should_render = true;
- if (event.LeftIsDown())
- {
- manager.addPoint(point);
- should_render = true;
- }
- else if (event.RightIsDown())
- {
- // FIXME
- manager.removeLastPoint();
- manager.removeLastPoint();
- should_render = true;
- }
- else if (event.MiddleIsDown())
- {
- manager.addPolyLine(point);
- should_render = true;
- }
- else
- {
- manager.removeLastPoint();
- manager.addPoint(point);
- should_render = true;
- }
- // if (event.Leaving()) { }
- // else if (event.Entering()) { }
-
- if (should_render)
- Render();
- // To catch keyboard events
- SetFocus();
-}
-
-void MyCanvas::evt_key_down_cb(wxKeyEvent & event)
-{
- bool should_render = false;
- switch (event.GetKeyCode())
- {
- case WXK_TAB:
- if (manager.getStyle() == POLYGON)
- manager.setStyle(LINES);
- else
- manager.setStyle(POLYGON);
- should_render = true;
- break;
- case WXK_UP:
- break;
- case WXK_DOWN:
- break;
- case WXK_LEFT:
- break;
- case WXK_RIGHT:
- break;
- default:
- break;
- }
- if (should_render)
- Render();
-}
-
-void MyCanvas::setup_polyline()
-{
- manager.clear();
-}
-
-void MyCanvas::Render()
-{
- static bool polyline_is_set = false;
-
- SetCurrent();
- wxPaintDC(this);
-
- if (! polyline_is_set)
- {
- setup_polyline();
- polyline_is_set = true;
- }
-
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
- glViewport(0, 0, (GLint) GetSize().x, (GLint) GetSize().y);
-
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- glOrtho (
- 0.0f, (float) GetSize().x, // left, right
- (float) GetSize().y, 0.0f, // bottom, top
- -1.0, 1.0f);
- glMatrixMode (GL_MODELVIEW);
- glLoadIdentity (); // FIXME? is this needed here?
-
- manager.draw();
- draw_marquee(mousex, mousey);
-
- glFlush();
- SwapBuffers();
-}
-
-class MyApp: public wxApp
-{
- private:
- virtual bool OnInit();
- MyCanvas * MyGLCanvas;
-};
-
-IMPLEMENT_APP(MyApp)
-
-bool MyApp::OnInit()
-{
- wxFrame *frame = new wxFrame((wxFrame *) NULL, -1, wxT("LibreMapping - PolyLine Prototype"), wxPoint(50, 50), wxSize(640, 480));
- //frame->SetWindowStyle(wxWANTS_CHARS);
- MyGLCanvas = new MyCanvas(frame);
-
- frame->Show(TRUE);
- return TRUE;
-}
diff --git a/resources/images/logo/splash.png b/resources/images/logo/splash.png
index aebcbd9e..412185f6 100644
Binary files a/resources/images/logo/splash.png and b/resources/images/logo/splash.png differ
diff --git a/resources/macOS/Info.plist b/resources/macOS/Info.plist
index 4708cb98..d0c0cb31 100644
--- a/resources/macOS/Info.plist
+++ b/resources/macOS/Info.plist
@@ -3,7 +3,7 @@
CFBundleIdentifier
-info.mapmapteam.MapMap
+com.artpluscode.MapMap
CFBundleName
mapmap
CFBundleExecutable
diff --git a/src/app/main.cpp b/src/app/main.cpp
index b3a481ec..47d9a987 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -37,14 +37,18 @@ void initRegistry()
{
MetaObjectRegistry& registry = MetaObjectRegistry::instance();
- // Paints.
+ // Sources.
registry.add();
registry.add();
registry.add();
- // Mappings.
- registry.add();
- registry.add();
+ // Layers (formerly Mappings).
+ registry.add();
+ registry.add();
+
+ // Backward compatibility for old project files.
+ registry.addAlias("mmp::TextureMapping", &TextureLayer::staticMetaObject);
+ registry.addAlias("mmp::ColorMapping", &ColorLayer::staticMetaObject);
// Shapes.
registry.add();
@@ -139,12 +143,12 @@ int main(int argc, char *argv[])
qtTranslator.load(QString("qt_%1").arg(lang),
QApplication::applicationDirPath().append("/translations"));
#else
- qtTranslator.load(QString("qtbase_%1").arg(lang),
+ (void)qtTranslator.load(QString("qtbase_%1").arg(lang),
QLibraryInfo::path(QLibraryInfo::TranslationsPath));
#endif
app.installTranslator(&qtTranslator);
- appTranslator.load(QString(":/translations_mapmap_%1").arg(lang));
+ (void)appTranslator.load(QString(":/translations_mapmap_%1").arg(lang));
app.installTranslator(&appTranslator);
}
else {
@@ -173,7 +177,7 @@ int main(int argc, char *argv[])
// Load stylesheet.
QFile stylesheet(":/stylesheet");
- stylesheet.open(QFile::ReadOnly);
+ (void)stylesheet.open(QFile::ReadOnly);
app.setStyleSheet(QLatin1String(stylesheet.readAll()));
// read positional argument:
diff --git a/src/control/OscInterface.cpp b/src/control/OscInterface.cpp
index bfe1a3b5..e330bfa8 100644
--- a/src/control/OscInterface.cpp
+++ b/src/control/OscInterface.cpp
@@ -28,15 +28,15 @@
namespace mmp {
static const QString OSC_ROOT("mapmap");
-static const QString OSC_PAINT("paint");
-static const QString OSC_MAPPING("mapping");
+static const QString OSC_SOURCE("source");
+static const QString OSC_LAYER("layer");
static const QString OSC_QUIT("quit");
static const QString OSC_PLAY("play");
static const QString OSC_PAUSE("pause");
static const QString OSC_REWIND("rewind");
-static const QString OSC_PAINT_MEDIA("media");
-static const QString OSC_PAINT_COLOR("color");
+static const QString OSC_SOURCE_MEDIA("media");
+static const QString OSC_SOURCE_COLOR("color");
OscInterface::OscInterface(
int listen_port) :
@@ -90,7 +90,7 @@ void OscInterface::messageReceivedCb(const QString& oscAddress, const QVariantLi
QString types = "";
for (int i = 0; i < arguments.count(); ++ i) {
QVariant argument = arguments[i];
- QMetaType::Type type = static_cast(argument.type());
+ QMetaType::Type type = static_cast(argument.typeId());
if (type == QMetaType::Int) {
types += "i";
@@ -126,15 +126,15 @@ static void printCommand(QVariantList &command)
{
for (int i = 0; i < command.size(); ++i)
{
- if (command.at(i).type() == QVariant::Int)
+ if (command.at(i).typeId() == QMetaType::Int)
{
qDebug() << command.at(i).toInt() << " ";
}
- else if (command.at(i).type() == QVariant::Double)
+ else if (command.at(i).typeId() == QMetaType::Double)
{
qDebug() << command.at(i).toDouble() << " ";
}
- else if (command.at(i).type() == QVariant::String)
+ else if (command.at(i).typeId() == QMetaType::QString)
{
qDebug() << command.at(i).toString() << " ";
}
@@ -161,11 +161,11 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma
{
return;
}
- if (command.at(0).type() != QVariant::String)
+ if (command.at(0).typeId() != QMetaType::QString)
{
return;
}
- if (command.at(1).type() != QVariant::String)
+ if (command.at(1).typeId() != QMetaType::QString)
{
return;
}
@@ -174,7 +174,7 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma
QString typetags = command.at(1).toString();
bool pathIsValid = false;
- // Walks through each token in the form /mapmap/paint/color - The first token is "mapmap", and then "paint"
+ // Walks through each token in the form /mapmap/source/color - The first token is "mapmap", and then "source"
QPair iterator = next(path);
if (iterator.first.isEmpty()) {
@@ -185,24 +185,23 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma
// Check type.
iterator = next(iterator.second);
- // Paint.
- if (iterator.first == OSC_PAINT)
+ // Source.
+ if (iterator.first == OSC_SOURCE)
{
- // Find paint (or paints).
+ // Find source (or sources).
if (command.size() >= 3)
{
- // Find paint (or paints).
- QVector paints;
- if (command.at(2).type() == QVariant::String)
- paints = main_window.getMappingManager().getPaintsByNameRegExp(command.at(2).toString());
+ QVector sources;
+ if (command.at(2).typeId() == QMetaType::QString)
+ sources = main_window.getMappingManager().getSourcesByNameRegExp(command.at(2).toString());
else
{
int id = command.at(2).toInt();
- paints.push_back(main_window.getMappingManager().getPaintById(id));
+ sources.push_back(main_window.getMappingManager().getSourceById(id));
}
- // Process all paints.
+ // Process all sources.
iterator = next(iterator.second);
- for (Paint::ptr elem: paints)
+ for (Source::ptr elem: sources)
{
// Rewind.
if (iterator.first == OSC_REWIND)
@@ -212,35 +211,34 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma
}
// Property setting (eg. opacity)
else if (command.size() >= 4) {
- qDebug() << "Attempt to set a paint property" << iterator.first << command.at(3);
+ qDebug() << "Attempt to set a source property" << iterator.first << command.at(3);
pathIsValid |= setElementProperty(elem, iterator.first, command.at(3));
}
}
}
}
- // Mapping.
- else if (iterator.first == OSC_MAPPING)
+ // Layer.
+ else if (iterator.first == OSC_LAYER)
{
- // Find mapping (or mappings).
+ // Find layer (or layers).
if (command.size() >= 3)
{
- QVector mappings;
- if (command.at(2).type() == QVariant::String)
- mappings = main_window.getMappingManager().getMappingsByNameRegExp(command.at(2).toString());
+ QVector layers;
+ if (command.at(2).typeId() == QMetaType::QString)
+ layers = main_window.getMappingManager().getLayersByNameRegExp(command.at(2).toString());
else
{
int id = command.at(2).toInt();
- main_window.getMappingManager().getMappingById(id);
- Mapping::ptr mapping = main_window.getMappingManager().getMappingById(id);
- if (!mapping.isNull())
- mappings.push_back(mapping);
+ Layer::ptr layer = main_window.getMappingManager().getLayerById(id);
+ if (!layer.isNull())
+ layers.push_back(layer);
}
- // Process all mappings (set property).
+ // Process all layers (set property).
if (command.size() >= 4)
{
iterator = next(iterator.second);
- for (Mapping::ptr elem: mappings)
+ for (Layer::ptr elem: layers)
{
pathIsValid |= setElementProperty(elem, iterator.first, command.at(3));
}
diff --git a/src/control/qosc/oscsender.cpp b/src/control/qosc/oscsender.cpp
index cb750122..e147fed4 100644
--- a/src/control/qosc/oscsender.cpp
+++ b/src/control/qosc/oscsender.cpp
@@ -41,7 +41,7 @@ void OscSender::variantListToByteArray(QByteArray& outputResult, const QString&
for (int i = 0; i < arguments.count(); ++ i) {
QVariant argument = arguments[i];
- QMetaType::Type type = static_cast(argument.type());
+ QMetaType::Type type = static_cast(argument.typeId());
if (type == QMetaType::Int) {
packet << argument.toInt();
diff --git a/src/core/CameraSurface.cpp b/src/core/CameraSurface.cpp
index d6ba1272..3843c03d 100644
--- a/src/core/CameraSurface.cpp
+++ b/src/core/CameraSurface.cpp
@@ -41,7 +41,10 @@ void CameraSurface::onVideoFrameChanged(const QVideoFrame& frame)
_temporaryImage = img;
#else
// Straighten the image for OpenGL (bottom-left origin convention).
+ QT_WARNING_PUSH
+ QT_WARNING_DISABLE_DEPRECATED
_temporaryImage = img.mirrored(true, false).transformed(QTransform().rotate(180));
+ QT_WARNING_POP
#endif
}
diff --git a/src/core/Commands.cpp b/src/core/Commands.cpp
index 9d33087b..4d3df57f 100644
--- a/src/core/Commands.cpp
+++ b/src/core/Commands.cpp
@@ -26,63 +26,63 @@
namespace mmp {
-AddPaintCommand::AddPaintCommand(MainWindow *mainWindow, uid paintId, const QIcon &icon, const QString &name, QUndoCommand *parent) :
+AddSourceCommand::AddSourceCommand(MainWindow *mainWindow, uid sourceId, const QIcon &icon, const QString &name, QUndoCommand *parent) :
QUndoCommand(parent),
_mainWindow(mainWindow),
- _paintId(paintId),
+ _sourceId(sourceId),
_icon(icon),
_name(name)
{
setText(QObject::tr("Add source"));
}
-void AddPaintCommand::undo()
+void AddSourceCommand::undo()
{
- _paint = _mainWindow->getMappingManager().getPaintById(_paintId);
- _mainWindow->removePaintItem(_paintId);
+ _source = _mainWindow->getMappingManager().getSourceById(_sourceId);
+ _mainWindow->removeSourceItem(_sourceId);
}
-void AddPaintCommand::redo()
+void AddSourceCommand::redo()
{
- if (!_paint.isNull())
+ if (!_source.isNull())
{
- uid lastId = _mainWindow->getMappingManager().addPaint(_paint);
- _mainWindow->addPaintItem(lastId, _icon, _name);
+ uid lastId = _mainWindow->getMappingManager().addSource(_source);
+ _mainWindow->addSourceItem(lastId, _icon, _name);
}
else {
- _mainWindow->addPaintItem(_paintId, _icon, _name);
+ _mainWindow->addSourceItem(_sourceId, _icon, _name);
}
}
-AddMappingCommand::AddMappingCommand(MainWindow *mainWindow, uid mappingId, QUndoCommand *parent):
+AddLayerCommand::AddLayerCommand(MainWindow *mainWindow, uid layerId, QUndoCommand *parent):
QUndoCommand(parent),
_mainWindow(mainWindow),
- _mappingId(mappingId)
+ _layerId(layerId)
{
setText(QObject::tr("Add layer"));
}
-void AddMappingCommand::undo()
+void AddLayerCommand::undo()
{
- _mapping = _mainWindow->getMappingManager().getMappingById(_mappingId);
- _mainWindow->deleteMapping(_mappingId);
+ _layer = _mainWindow->getMappingManager().getLayerById(_layerId);
+ _mainWindow->deleteLayer(_layerId);
}
-void AddMappingCommand::redo()
+void AddLayerCommand::redo()
{
- if (!_mapping.isNull())
+ if (!_layer.isNull())
{
- uid storedId = _mainWindow->getMappingManager().addMapping(_mapping);
- _mainWindow->addMappingItem(storedId);
+ uid storedId = _mainWindow->getMappingManager().addLayer(_layer);
+ _mainWindow->addLayerItem(storedId);
}
else
{
- _mainWindow->addMappingItem(_mappingId);
+ _mainWindow->addLayerItem(_layerId);
}
}
-DuplicateMappingCommand::DuplicateMappingCommand(MainWindow *mainWindow, uid cloneId, QUndoCommand *parent):
- AddMappingCommand(mainWindow, cloneId, parent)
+DuplicateLayerCommand::DuplicateLayerCommand(MainWindow *mainWindow, uid cloneId, QUndoCommand *parent):
+ AddLayerCommand(mainWindow, cloneId, parent)
{
setText(QObject::tr("Duplicate layer"));
}
@@ -252,73 +252,73 @@ void TranslateShapeCommand::_doTransform(MShape::ptr shape)
shape->translate(_translation);
}
-RemovePaintCommand::RemovePaintCommand(MainWindow *mainWindow, uid paintId, QUndoCommand *parent):
+RemoveSourceCommand::RemoveSourceCommand(MainWindow *mainWindow, uid sourceId, QUndoCommand *parent):
QUndoCommand(parent),
_mainWindow(mainWindow),
- _paintId(paintId),
- _paintMappings()
+ _sourceId(sourceId),
+ _sourceLayers()
{
setText(QObject::tr("Remove media"));
}
-void RemovePaintCommand::undo()
+void RemoveSourceCommand::undo()
{
- if (!_paint.isNull())
+ if (!_source.isNull())
{
- MappingManager& mappingManager = _mainWindow->getMappingManager();
- uid lastId = mappingManager.addPaint(_paint);
- _mainWindow->addPaintItem(lastId, _paint->getIcon(), _paint->getName());
-
- // Add all mappings associated with paint.
- QMap paintMappings = mappingManager.getPaintMappings(_paint);
- for (QMap::const_iterator it = _paintMappings.constBegin();
- it != _paintMappings.constEnd(); ++it) {
- uid mid = mappingManager.addMapping( it.value() );
+ MappingManager& manager = _mainWindow->getMappingManager();
+ uid lastId = manager.addSource(_source);
+ _mainWindow->addSourceItem(lastId, _source->getIcon(), _source->getName());
+
+ // Add all mappings associated with source.
+ QMap sourceLayers = manager.getSourceLayers(_source);
+ for (QMap::const_iterator it = _sourceLayers.constBegin();
+ it != _sourceLayers.constEnd(); ++it) {
+ uid mid = manager.addLayer( it.value() );
Q_ASSERT( mid == it.key() );
- _mainWindow->addMappingItem(mid);
+ _mainWindow->addLayerItem(mid);
}
}
}
-void RemovePaintCommand::redo()
+void RemoveSourceCommand::redo()
{
- MappingManager& mappingManager = _mainWindow->getMappingManager();
- bool deleteWithoutPrompt = (!_paint.isNull()); // to avoid the pop-up window when redoing after undoing
- _paint = mappingManager.getPaintById(_paintId);
- _paintMappings = mappingManager.getPaintMappings(_paint);
- _mainWindow->deletePaint(_paintId, deleteWithoutPrompt);
+ MappingManager& manager = _mainWindow->getMappingManager();
+ bool deleteWithoutPrompt = (!_source.isNull()); // to avoid the pop-up window when redoing after undoing
+ _source = manager.getSourceById(_sourceId);
+ _sourceLayers = manager.getSourceLayers(_source);
+ _mainWindow->deleteSource(_sourceId, deleteWithoutPrompt);
}
-DeleteMappingCommand::DeleteMappingCommand(MainWindow *mainWindow, uid mappingId, QUndoCommand *parent) :
+DeleteLayerCommand::DeleteLayerCommand(MainWindow *mainWindow, uid layerId, QUndoCommand *parent) :
QUndoCommand(parent),
_mainWindow(mainWindow),
- _mappingId(mappingId)
+ _layerId(layerId)
{
setText(QObject::tr("Delete layer"));
}
-void DeleteMappingCommand::undo()
+void DeleteLayerCommand::undo()
{
- if (!_mapping.isNull())
+ if (!_layer.isNull())
{
- uid storedId = _mainWindow->getMappingManager().addMapping(_mapping);
- _mainWindow->addMappingItem(storedId);
+ uid storedId = _mainWindow->getMappingManager().addLayer(_layer);
+ _mainWindow->addLayerItem(storedId);
}
}
-void DeleteMappingCommand::redo()
+void DeleteLayerCommand::redo()
{
// Store mapping pointer before delete it
- _mapping = _mainWindow->getMappingManager().getMappingById(_mappingId);
- _mainWindow->deleteMapping(_mappingId);
+ _layer = _mainWindow->getMappingManager().getLayerById(_layerId);
+ _mainWindow->deleteLayer(_layerId);
}
-MoveMappingCommand::MoveMappingCommand(MainWindow *mainWindow, uid mappingId, MM::MoveElement moveType, QUndoCommand *parent) :
+MoveLayerCommand::MoveLayerCommand(MainWindow *mainWindow, uid layerId, MM::MoveElement moveType, QUndoCommand *parent) :
QUndoCommand(parent),
_mainWindow(mainWindow),
- _mappingId(mappingId),
+ _layerId(layerId),
_moveType(moveType)
{
switch (moveType) {
@@ -330,32 +330,32 @@ MoveMappingCommand::MoveMappingCommand(MainWindow *mainWindow, uid mappingId, M
}
}
-void MoveMappingCommand::undo()
+void MoveLayerCommand::undo()
{
- if (!_mapping.isNull())
+ if (!_layer.isNull())
{
// Do the inverse move.
- _mainWindow->moveMapping(_mappingId, _fromIdx);
+ _mainWindow->moveLayer(_layerId, _fromIdx);
}
}
-void MoveMappingCommand::redo()
+void MoveLayerCommand::redo()
{
// Store mapping pointer before delete it
- _mapping = _mainWindow->getMappingManager().getMappingById(_mappingId);
- _fromIdx = _mainWindow->getMappingManager().getMappingIndex(_mapping);
- int maxMappingIdx = _mainWindow->getMappingManager().nMappings()-1;
+ _layer = _mainWindow->getMappingManager().getLayerById(_layerId);
+ _fromIdx = _mainWindow->getMappingManager().getLayerIndex(_layer);
+ int maxLayerIdx = _mainWindow->getMappingManager().nLayers()-1;
switch (_moveType) {
case MM::Raise: _toIdx = qMax(_fromIdx - 1, 0); break;
- case MM::Lower: _toIdx = qMin(_fromIdx + 1, maxMappingIdx); break;
+ case MM::Lower: _toIdx = qMin(_fromIdx + 1, maxLayerIdx); break;
case MM::Top: _toIdx = 0; break;
- case MM::Bottom: _toIdx = maxMappingIdx; break;
+ case MM::Bottom: _toIdx = maxLayerIdx; break;
default:; // should not happen
}
// Do the move.
- _mainWindow->moveMapping(_mappingId, _toIdx);
+ _mainWindow->moveLayer(_layerId, _toIdx);
}
FlipShapeCommand::FlipShapeCommand(MapperGLCanvas *canvas, TransformShapeCommand::TransformShapeOption option, const MShape::ptr &initialShape, MShape::FlipDirection direction, QUndoCommand *parent)
diff --git a/src/core/Commands.h b/src/core/Commands.h
index 0dab6cee..caa55697 100644
--- a/src/core/Commands.h
+++ b/src/core/Commands.h
@@ -43,40 +43,40 @@ enum CommandId {
class MainWindow;
class MapperGLCanvas;
-class AddPaintCommand : public QUndoCommand
+class AddSourceCommand : public QUndoCommand
{
public:
- explicit AddPaintCommand(MainWindow *mainWindow, uid paintId, const QIcon &icon, const QString &name, QUndoCommand *parent = 0);
+ explicit AddSourceCommand(MainWindow *mainWindow, uid sourceId, const QIcon &icon, const QString &name, QUndoCommand *parent = 0);
void undo() Q_DECL_OVERRIDE;
void redo() Q_DECL_OVERRIDE;
private:
MainWindow *_mainWindow;
- Paint::ptr _paint;
- uid _paintId;
+ Source::ptr _source;
+ uid _sourceId;
QIcon _icon;
QString _name;
};
-class AddMappingCommand : public QUndoCommand
+class AddLayerCommand : public QUndoCommand
{
public:
- explicit AddMappingCommand(MainWindow *mainWindow, uid mappingId, QUndoCommand *parent = 0);
+ explicit AddLayerCommand(MainWindow *mainWindow, uid layerId, QUndoCommand *parent = 0);
void undo() Q_DECL_OVERRIDE;
void redo() Q_DECL_OVERRIDE;
private:
MainWindow *_mainWindow;
- Mapping::ptr _mapping;
- uid _mappingId;
+ Layer::ptr _layer;
+ uid _layerId;
};
-class DuplicateMappingCommand : public AddMappingCommand
+class DuplicateLayerCommand : public AddLayerCommand
{
public:
- explicit DuplicateMappingCommand(MainWindow *mainWindow, uid cloneId, QUndoCommand *parent = 0);
+ explicit DuplicateLayerCommand(MainWindow *mainWindow, uid cloneId, QUndoCommand *parent = 0);
};
@@ -194,47 +194,47 @@ class RotateShapeCommand : public TransformShapeCommand
MShape::ptr _initialShape;
};
-class RemovePaintCommand : public QUndoCommand
+class RemoveSourceCommand : public QUndoCommand
{
public:
- explicit RemovePaintCommand(MainWindow *mainWindow, uid paintId, QUndoCommand *parent = 0);
+ explicit RemoveSourceCommand(MainWindow *mainWindow, uid sourceId, QUndoCommand *parent = 0);
void undo() Q_DECL_OVERRIDE;
void redo() Q_DECL_OVERRIDE;
private:
MainWindow *_mainWindow;
- Paint::ptr _paint;
- uid _paintId;
- QMap _paintMappings; // saves mappings associated with paint
+ Source::ptr _source;
+ uid _sourceId;
+ QMap _sourceLayers; // saves mappings associated with source
};
-class DeleteMappingCommand : public QUndoCommand
+class DeleteLayerCommand : public QUndoCommand
{
public:
- explicit DeleteMappingCommand(MainWindow *mainWindow, uid mappingId, QUndoCommand *parent = 0);
+ explicit DeleteLayerCommand(MainWindow *mainWindow, uid layerId, QUndoCommand *parent = 0);
void undo() Q_DECL_OVERRIDE;
void redo() Q_DECL_OVERRIDE;
private:
MainWindow *_mainWindow;
- Mapping::ptr _mapping;
- uid _mappingId;
+ Layer::ptr _layer;
+ uid _layerId;
};
-class MoveMappingCommand : public QUndoCommand
+class MoveLayerCommand : public QUndoCommand
{
public:
- explicit MoveMappingCommand(MainWindow *mainWindow, uid mappingId, MM::MoveElement moveType, QUndoCommand *parent = 0);
+ explicit MoveLayerCommand(MainWindow *mainWindow, uid layerId, MM::MoveElement moveType, QUndoCommand *parent = 0);
void undo() Q_DECL_OVERRIDE;
void redo() Q_DECL_OVERRIDE;
private:
MainWindow *_mainWindow;
- Mapping::ptr _mapping;
- uid _mappingId;
+ Layer::ptr _layer;
+ uid _layerId;
MM::MoveElement _moveType;
int _fromIdx;
int _toIdx;
diff --git a/src/core/Mapping.cpp b/src/core/Layer.cpp
similarity index 66%
rename from src/core/Mapping.cpp
rename to src/core/Layer.cpp
index 68f2cf11..ee1916fa 100644
--- a/src/core/Mapping.cpp
+++ b/src/core/Layer.cpp
@@ -19,36 +19,36 @@
* along with this program. If not, see .
*/
-#include "Mapping.h"
+#include "Layer.h"
#include "MainWindow.h"
namespace mmp {
-UidAllocator Mapping::allocator;
+UidAllocator Layer::allocator;
-Mapping::Mapping(uid id)
-: Mapping(Paint::ptr(), MShape::ptr(), MShape::ptr(), id) {}
+Layer::Layer(uid id)
+: Layer(Source::ptr(), MShape::ptr(), MShape::ptr(), id) {}
-Mapping::Mapping(Paint::ptr paint, uid id)
-: Mapping(paint, MShape::ptr(), MShape::ptr(), id) {}
+Layer::Layer(Source::ptr source, uid id)
+: Layer(source, MShape::ptr(), MShape::ptr(), id) {}
-Mapping::Mapping(Paint::ptr paint, MShape::ptr shape, uid id)
-: Mapping(paint, shape, MShape::ptr(), id) {}
+Layer::Layer(Source::ptr source, MShape::ptr shape, uid id)
+: Layer(source, shape, MShape::ptr(), id) {}
-Mapping::Mapping(Paint::ptr paint, MShape::ptr shape, MShape::ptr inputShape, uid id)
+Layer::Layer(Source::ptr source, MShape::ptr shape, MShape::ptr inputShape, uid id)
: Element(id, &allocator),
- _paint(paint), _shape(shape), _inputShape(inputShape),
+ _source(source), _shape(shape), _inputShape(inputShape),
_isSolo(false), _isVisible(true)
{
// Default.
_depth = getId();
}
-Mapping::~Mapping() {
+Layer::~Layer() {
allocator.free(getId());
}
-void Mapping::setSolo(bool solo)
+void Layer::setSolo(bool solo)
{
if (solo != _isSolo)
{
@@ -57,7 +57,7 @@ void Mapping::setSolo(bool solo)
}
}
-void Mapping::setVisible(bool visible)
+void Layer::setVisible(bool visible)
{
if (visible != _isVisible)
{
@@ -66,7 +66,7 @@ void Mapping::setVisible(bool visible)
}
}
-void Mapping::setDepth(int depth)
+void Layer::setDepth(int depth)
{
if (depth != _depth)
{
@@ -75,7 +75,7 @@ void Mapping::setDepth(int depth)
}
}
-void Mapping::setLocked(bool locked)
+void Layer::setLocked(bool locked)
{
if (!_shape.isNull())
_shape->setLocked(locked);
@@ -84,26 +84,26 @@ void Mapping::setLocked(bool locked)
Element::setLocked(locked);
}
-void Mapping::setPaint(Paint::ptr paint)
+void Layer::setSource(Source::ptr source)
{
- if (paintIsCompatible(paint))
+ if (sourceIsCompatible(source))
{
- _paint = paint;
- _emitPropertyChanged("paintId");
+ _source = source;
+ _emitPropertyChanged("sourceId");
}
}
-void Mapping::setPaintById(uid paintId)
+void Layer::setSourceById(uid sourceId)
{
- setPaint(MainWindow::window()->getMappingManager().getPaintById(paintId));
+ setSource(MainWindow::window()->getMappingManager().getSourceById(sourceId));
}
-void Mapping::read(const QJsonObject& obj)
+void Layer::read(const QJsonObject& obj)
{
Element::read(obj);
- int paintId = obj[ProjectLabels::SOURCE_ID].toInt();
- setPaintById(paintId);
+ int sourceId = obj[ProjectLabels::SOURCE_ID].toInt();
+ setSourceById(sourceId);
// Read output shape.
_readShape(obj, true);
@@ -115,11 +115,11 @@ void Mapping::read(const QJsonObject& obj)
}
}
-void Mapping::write(QJsonObject& obj)
+void Layer::write(QJsonObject& obj)
{
Element::write(obj);
- obj[ProjectLabels::SOURCE_ID] = getPaintId();
+ obj[ProjectLabels::SOURCE_ID] = getSourceId();
// Write output shape.
_writeShape(obj, true);
@@ -131,7 +131,7 @@ void Mapping::write(QJsonObject& obj)
}
}
-void Mapping::_readShape(const QJsonObject& obj, bool isOutput)
+void Layer::_readShape(const QJsonObject& obj, bool isOutput)
{
QString tag = isOutput ? ProjectLabels::DESTINATION : ProjectLabels::SOURCE;
@@ -161,7 +161,7 @@ void Mapping::_readShape(const QJsonObject& obj, bool isOutput)
}
}
-void Mapping::_writeShape(QJsonObject& obj, bool isOutput)
+void Layer::_writeShape(QJsonObject& obj, bool isOutput)
{
QString tag = isOutput ? ProjectLabels::DESTINATION : ProjectLabels::SOURCE;
MShape::ptr shape = isOutput ? getShape() : getInputShape();
@@ -170,14 +170,14 @@ void Mapping::_writeShape(QJsonObject& obj, bool isOutput)
obj[tag] = shapeObj;
}
-bool ColorMapping::paintIsCompatible(Paint::ptr paint) const
+bool ColorLayer::sourceIsCompatible(Source::ptr source) const
{
- return paint->inherits("mmp::Color");
+ return source->inherits("mmp::Color");
}
-bool TextureMapping::paintIsCompatible(Paint::ptr paint) const
+bool TextureLayer::sourceIsCompatible(Source::ptr source) const
{
- return paint->inherits("mmp::Texture");
+ return source->inherits("mmp::Texture");
}
}
diff --git a/src/core/Mapping.h b/src/core/Layer.h
similarity index 68%
rename from src/core/Mapping.h
rename to src/core/Layer.h
index 194aec80..c497a8ae 100644
--- a/src/core/Mapping.h
+++ b/src/core/Layer.h
@@ -19,13 +19,13 @@
* along with this program. If not, see .
*/
-#ifndef MAPPING_H_
-#define MAPPING_H_
+#ifndef LAYER_H_
+#define LAYER_H_
#include
#include "Shape.h"
-#include "Paint.h"
+#include "Source.h"
#include "Element.h"
@@ -43,8 +43,8 @@ namespace mmp {
/**
* Mapping is the central concept of this software.
*
- * A Mapping represents a relationship between an input Paint and
- * and output Shape where the paint (possibly modified by some other
+ * A Mapping represents a relationship between an input Source and
+ * and output Shape where the source (possibly modified by some other
* attributes or an input Shape in the case of TextureMapping) is
* projected on the output shape.
*
@@ -52,7 +52,7 @@ namespace mmp {
* can thus change their opacity level, toggle their visibility, set
* them in "solo" mode and lock them.
*/
-class Mapping : public Element
+class Layer : public Element
{
Q_OBJECT
@@ -64,12 +64,12 @@ class Mapping : public Element
// Q_PROPERTY(MShape::ptr inputShape READ getInputShape)
Q_PROPERTY(bool hasInputShape READ hasInputShape STORED false)
- Q_PROPERTY(uid paintId READ getPaintId WRITE setPaintById STORED false)
-// Q_PROPERTY(Paint::ptr paint READ getPaint WRITE setPaint)
+ Q_PROPERTY(uid sourceId READ getSourceId WRITE setSourceById STORED false)
+// Q_PROPERTY(Source::ptr source READ getSource WRITE setSource)
protected:
- /// The input Paint instance.
- Paint::ptr _paint;
+ /// The input Source instance.
+ Source::ptr _source;
/// The output Shape instance.
MShape::ptr _shape;
@@ -85,24 +85,24 @@ class Mapping : public Element
int _depth; // depth of the layer
protected:
- Mapping(int id=NULL_UID);
- Mapping(Paint::ptr paint, uid id=NULL_UID);
- Mapping(Paint::ptr paint, MShape::ptr shape, uid id=NULL_UID);
- Mapping(Paint::ptr paint, MShape::ptr shape, MShape::ptr inputShape, uid id=NULL_UID);
+ Layer(int id=NULL_UID);
+ Layer(Source::ptr source, uid id=NULL_UID);
+ Layer(Source::ptr source, MShape::ptr shape, uid id=NULL_UID);
+ Layer(Source::ptr source, MShape::ptr shape, MShape::ptr inputShape, uid id=NULL_UID);
public:
- typedef QSharedPointer ptr;
+ typedef QSharedPointer ptr;
- virtual ~Mapping();
+ virtual ~Layer();
static const UidAllocator& getUidAllocator() { return allocator; }
/**
- * Sets up this Mapping: its Paint and its Shape.
- * Calls the build() method of its Paint and Shape.
+ * Sets up this Mapping: its Source and its Shape.
+ * Calls the build() method of its Source and Shape.
*/
virtual void build() {
- _paint->build();
+ _source->build();
_shape->build();
if (hasInputShape())
_inputShape->build();
@@ -112,16 +112,16 @@ class Mapping : public Element
virtual MShape::ShapeType getType() const = 0;
// Return copy of this mapping.
- virtual Mapping* clone() const = 0;
+ virtual Layer* clone() const = 0;
- /// Returns true iff paint is compatible with mapping.
- virtual bool paintIsCompatible(Paint::ptr paint) const = 0;
+ /// Returns true iff source is compatible with mapping.
+ virtual bool sourceIsCompatible(Source::ptr source) const = 0;
- /// Returns the paint.
- Paint::ptr getPaint() const { return _paint; }
+ /// Returns the source.
+ Source::ptr getSource() const { return _source; }
- /// Returns paint id.
- uid getPaintId() const { return _paint->getId(); }
+ /// Returns source id.
+ uid getSourceId() const { return _source->getId(); }
/// Returns the (output) shape.
MShape::ptr getShape() const { return _shape; }
@@ -145,10 +145,10 @@ class Mapping : public Element
virtual void toggleSolo() { setSolo(!isSolo()); }
virtual void toggleVisible() { setVisible(!isVisible()); }
- virtual float getComputedOpacity() const { return getOpacity() * _paint->getOpacity(); }
+ virtual float getComputedOpacity() const { return getOpacity() * _source->getOpacity(); }
- virtual void setPaint(Paint::ptr paint);
- virtual void setPaintById(uid paintId);
+ virtual void setSource(Source::ptr source);
+ virtual void setSourceById(uid sourceId);
virtual void setShape(MShape::ptr s) { _shape = s; }
virtual void setInputShape(MShape::ptr s) { _inputShape = s; }
@@ -161,30 +161,30 @@ class Mapping : public Element
};
/**
- * Mapping of a Color paint into a shape.
+ * Mapping of a Color source into a shape.
*/
-class ColorMapping : public Mapping
+class ColorLayer : public Layer
{
Q_OBJECT
public:
- Q_INVOKABLE ColorMapping(int id=NULL_UID)
- : Mapping(id) {}
+ Q_INVOKABLE ColorLayer(int id=NULL_UID)
+ : Layer(id) {}
- ColorMapping(Paint::ptr paint, MShape::ptr shape,
+ ColorLayer(Source::ptr source, MShape::ptr shape,
uid id=NULL_UID)
- : Mapping(paint, shape, id) {}
+ : Layer(source, shape, id) {}
// Return copy of this mapping.
- virtual Mapping* clone() const {
+ virtual Layer* clone() const {
MShape::ptr shape(_shape->clone());
- return new ColorMapping(_paint, shape);
+ return new ColorLayer(_source, shape);
}
/// Returns true iff the mapping possesses an input (source) shape.
virtual bool hasInputShape() const { return false; }
- /// Returns true iff paint is compatible with mapping.
- virtual bool paintIsCompatible(Paint::ptr paint) const;
+ /// Returns true iff source is compatible with mapping.
+ virtual bool sourceIsCompatible(Source::ptr source) const;
virtual MShape::ShapeType getType() const {
return getShape()->getType();
@@ -193,37 +193,37 @@ class ColorMapping : public Mapping
};
/**
- * Object whose paint is an image texture. In the case of a texture mapping we require
+ * Object whose source is an image texture. In the case of a texture mapping we require
* an additional input shape to specify the area on the image where we pick the pixels.
*/
-class TextureMapping : public Mapping
+class TextureLayer : public Layer
{
Q_OBJECT
public:
- Q_INVOKABLE TextureMapping(int id=NULL_UID)
- : Mapping(id) {}
+ Q_INVOKABLE TextureLayer(int id=NULL_UID)
+ : Layer(id) {}
- TextureMapping(Paint::ptr paint,
+ TextureLayer(Source::ptr source,
MShape::ptr shape,
MShape::ptr inputShape, uid id=NULL_UID)
- : Mapping(paint, shape, inputShape, id)
+ : Layer(source, shape, inputShape, id)
{
// Only supports shape of the same type (for now).
Q_ASSERT(shape->getType() == inputShape->getType());
}
// Return copy of this mapping.
- virtual Mapping* clone() const {
+ virtual Layer* clone() const {
MShape::ptr shape(_shape->clone());
MShape::ptr inputShape(_inputShape->clone());
- return new TextureMapping(_paint, shape, inputShape);
+ return new TextureLayer(_source, shape, inputShape);
}
/// Returns true iff the mapping possesses an input (source) shape.
virtual bool hasInputShape() const { return true; }
- /// Returns true iff paint is compatible with mapping.
- virtual bool paintIsCompatible(Paint::ptr paint) const;
+ /// Returns true iff source is compatible with mapping.
+ virtual bool sourceIsCompatible(Source::ptr source) const;
virtual MShape::ShapeType getType() const {
return getShape()->getType();
@@ -232,4 +232,4 @@ class TextureMapping : public Mapping
}
-#endif /* MAPPING_H_ */
+#endif /* LAYER_H_ */
diff --git a/src/core/MM.cpp b/src/core/MM.cpp
index 6f8df50f..f81c7bf2 100644
--- a/src/core/MM.cpp
+++ b/src/core/MM.cpp
@@ -24,9 +24,10 @@ namespace mmp {
const QString MM::APPLICATION_NAME = "MapMap";
const QString MM::VERSION = "0.6.3";
-const QString MM::COPYRIGHT_OWNERS = "Sofian Audry, Dame Diongue, Alexandre Quessy, Mike Latona, Vasilis Liaskovitis";
+const QString MM::COPYRIGHT_OWNERS = "Alexandre Quessy, Sofian Audry, Dame Diongue, Mike Latona, Vasilis Liaskovitis";
const QString MM::ORGANIZATION_NAME = "MapMap";
-const QString MM::ORGANIZATION_DOMAIN = "mapmap.info";
+const QString MM::ORGANIZATION_DOMAIN = "artpluscode.com";
+const QString MM::WEBSITE_URL = "https://mapmapteam.github.io";
const QString MM::FILE_EXTENSION = "mmp";
const QString MM::VIDEO_FILES_FILTER = "*.mov *.mp4 *.avi *.ogg *.ogv *.mpeg *.mpeg1 *.mpeg4 *.mpg *.mpg2 *.mp2 *.mjpq *.mjp *.wmv *.webm *sock";
const QString MM::IMAGE_FILES_FILTER = "*.jpg *.jpeg *.gif *.png *.tiff *.tif *.bmp";
diff --git a/src/core/MM.h b/src/core/MM.h
index 91928c1a..a9fec16a 100644
--- a/src/core/MM.h
+++ b/src/core/MM.h
@@ -55,6 +55,7 @@ class MM
static const QString COPYRIGHT_OWNERS;
static const QString ORGANIZATION_NAME;
static const QString ORGANIZATION_DOMAIN;
+ static const QString WEBSITE_URL;
static const QString FILE_EXTENSION;
static const QString VIDEO_FILES_FILTER;
static const QString IMAGE_FILES_FILTER;
diff --git a/src/core/MappingManager.cpp b/src/core/MappingManager.cpp
index 2bb12855..6aa25118 100644
--- a/src/core/MappingManager.cpp
+++ b/src/core/MappingManager.cpp
@@ -29,82 +29,82 @@ MappingManager::MappingManager()
}
-QMap MappingManager::getPaintMappings(const Paint::ptr paint) const
+QMap MappingManager::getSourceLayers(const Source::ptr source) const
{
- QMap paintMappings;
- for (QVector::const_iterator it = mappingVector.begin(); it != mappingVector.end(); ++it)
+ QMap sourceLayers;
+ for (QVector::const_iterator it = layerVector.begin(); it != layerVector.end(); ++it)
{
- if ((*it)->getPaint() == paint)
+ if ((*it)->getSource() == source)
{
- paintMappings[(*it)->getId()] = *it;
+ sourceLayers[(*it)->getId()] = *it;
}
}
- return paintMappings;
+ return sourceLayers;
}
-Paint::ptr MappingManager::getPaintByName(QString name)
+Source::ptr MappingManager::getSourceByName(QString name)
{
- return _getElementByName(paintVector, name);
+ return _getElementByName(sourceVector, name);
}
-QVector MappingManager::getPaintsByNameRegExp(QString namePattern)
+QVector MappingManager::getSourcesByNameRegExp(QString namePattern)
{
- return _getElementsByNameRegExp(paintVector, namePattern);
+ return _getElementsByNameRegExp(sourceVector, namePattern);
}
-QVector MappingManager::getPaintsCompatibleWith(Mapping::ptr mapping)
+QVector MappingManager::getSourcesCompatibleWith(Layer::ptr layer)
{
- QVector paints;
- for (QVector::const_iterator it = paintVector.constBegin();
- it != paintVector.constEnd(); ++it)
- if (mapping->paintIsCompatible(*it))
+ QVector paints;
+ for (QVector::const_iterator it = sourceVector.constBegin();
+ it != sourceVector.constEnd(); ++it)
+ if (layer->sourceIsCompatible(*it))
paints.append(*it);
return paints;
}
-Mapping::ptr MappingManager::getMappingByName(QString name)
+Layer::ptr MappingManager::getLayerByName(QString name)
{
- return _getElementByName(mappingVector, name);
+ return _getElementByName(layerVector, name);
}
-QVector MappingManager::getMappingsByNameRegExp(QString namePattern)
+QVector MappingManager::getLayersByNameRegExp(QString namePattern)
{
- return _getElementsByNameRegExp(mappingVector, namePattern);
+ return _getElementsByNameRegExp(layerVector, namePattern);
}
-QMap MappingManager::getPaintMappingsById(uid paintId) const
+QMap MappingManager::getSourceLayersById(uid sourceId) const
{
- return getPaintMappings(paintMap[paintId]);
+ return getSourceLayers(sourceMap[sourceId]);
}
-uid MappingManager::addPaint(Paint::ptr paint)
+uid MappingManager::addSource(Source::ptr source)
{
- paintVector.push_back(paint);
- paintMap[paint->getId()] = paint;
- return paint->getId();
+ sourceVector.push_back(source);
+ sourceMap[source->getId()] = source;
+ return source->getId();
}
-bool MappingManager::removePaint(uid paintId)
+bool MappingManager::removeSource(uid sourceId)
{
- // Make sure the paint to which this paint refers to exists in the manager.
- Paint::ptr paint = getPaintById(paintId);
- if (paint)
+ // Make sure the source to which this source refers to exists in the manager.
+ Source::ptr source = getSourceById(sourceId);
+ if (source)
{
- // Remove all mappings associated with paint.
- QMap paintMappings = getPaintMappings(paint);
- for (QMap::const_iterator it = paintMappings.constBegin();
- it != paintMappings.constEnd(); ++it)
+ // Remove all mappings associated with source.
+ QMap sourceLayers = getSourceLayers(source);
+ for (QMap::const_iterator it = sourceLayers.constBegin();
+ it != sourceLayers.constEnd(); ++it)
{
- removeMapping(it.key());
+ removeLayer(it.key());
}
- // Remove paint.
- int idx = paintVector.lastIndexOf(paint);
+ // Remove source.
+ int idx = sourceVector.lastIndexOf(source);
Q_ASSERT(idx != -1);
- paintVector.remove(idx);
- paintMap.remove(paintId);
- paint->~Paint(); // FIX ME: Explicit call of paint destructor in order add Camera more than once
+ sourceVector.remove(idx);
+ sourceMap.remove(sourceId);
+ source->~Source(); // FIX ME: Explicit call of source destructor in order add Camera more than once
return true;
}
else
@@ -113,18 +113,18 @@ bool MappingManager::removePaint(uid paintId)
}
}
-bool MappingManager::replacePaintMappings(Paint::ptr oldpaint,
- Paint::ptr newpaint)
+bool MappingManager::replaceSourceLayers(Source::ptr oldSource,
+ Source::ptr newSource)
{
- // Make sure the paint to which this paint refers to exists in the manager.
- if (oldpaint && newpaint)
+ // Make sure the source to which this source refers to exists in the manager.
+ if (oldSource && newSource)
{
- QMap paintMappings = getPaintMappings(oldpaint);
- for (QMap::const_iterator it = paintMappings.constBegin();
- it != paintMappings.constEnd(); ++it)
+ QMap sourceLayers = getSourceLayers(oldSource);
+ for (QMap::const_iterator it = sourceLayers.constBegin();
+ it != sourceLayers.constEnd(); ++it)
{
- Mapping::ptr mapping = it.value();
- mapping->setPaint(newpaint);
+ Layer::ptr layer = it.value();
+ layer->setSource(newSource);
}
return true;
}
@@ -134,28 +134,28 @@ bool MappingManager::replacePaintMappings(Paint::ptr oldpaint,
}
}
-uid MappingManager::addMapping(Mapping::ptr mapping)
+uid MappingManager::addLayer(Layer::ptr layer)
{
- // Make sure the paint to which this mapping refers to exists in the manager.
- Q_ASSERT ( paintVector.contains(mapping->getPaint()) );
+ // Make sure the source to which this mapping refers to exists in the manager.
+ Q_ASSERT ( sourceVector.contains(layer->getSource()) );
- mappingVector.insert(0, mapping);
- mappingMap[mapping->getId()] = mapping;
+ layerVector.insert(0, layer);
+ layerMap[layer->getId()] = layer;
- return mapping->getId();
+ return layer->getId();
}
-bool MappingManager::removeMapping(uid mappingId)
+bool MappingManager::removeLayer(uid mappingId)
{
- // Make sure the paint to which this mapping refers to exists in the manager.
- Mapping::ptr mapping = getMappingById(mappingId);
- if (mapping)
+ // Make sure the source to which this mapping refers to exists in the manager.
+ Layer::ptr layer = getLayerById(mappingId);
+ if (layer)
{
- int idx = mappingVector.lastIndexOf(mapping);
- Q_ASSERT( idx != -1 ); // Q_ASSERT(mappingVector.contains(mapping));
- mappingVector.remove(idx);
- mappingMap.remove(mappingId);
- updateMappingsDepths();
+ int idx = layerVector.lastIndexOf(layer);
+ Q_ASSERT( idx != -1 ); // Q_ASSERT(layerVector.contains(layer));
+ layerVector.remove(idx);
+ layerMap.remove(mappingId);
+ updateLayerDepths();
return true;
}
@@ -166,14 +166,14 @@ bool MappingManager::removeMapping(uid mappingId)
}
/// Moves a mapping of given uid by a certain number of steps up or down.
-bool MappingManager::moveMapping(uid mappingId, int toIndex)
+bool MappingManager::moveLayer(uid mappingId, int toIndex)
{
- // Make sure the paint to which this mapping refers to exists in the manager.
- int idx = getMappingIndex(mappingId);
+ // Make sure the source to which this mapping refers to exists in the manager.
+ int idx = getLayerIndex(mappingId);
if (idx >= 0)
{
- mappingVector.move(idx, toIndex);
- updateMappingsDepths();
+ layerVector.move(idx, toIndex);
+ updateLayerDepths();
return true;
}
else
@@ -182,14 +182,14 @@ bool MappingManager::moveMapping(uid mappingId, int toIndex)
}
}
-QVector MappingManager::getVisibleMappings() const
+QVector MappingManager::getVisibleLayers() const
{
- QVector visible;
+ QVector visible;
// First pass: check if one of the mappings is in solo mode.
bool hasSolo = false;
- for (QVector::const_iterator it = mappingVector.begin();
- it != mappingVector.end(); ++it)
+ for (QVector::const_iterator it = layerVector.begin();
+ it != layerVector.end(); ++it)
{
if ((*it)->isSolo())
{
@@ -199,8 +199,8 @@ QVector MappingManager::getVisibleMappings() const
}
// Second pass: fill the visible vector.
- for (QVector::const_iterator it = mappingVector.begin();
- it != mappingVector.end(); ++it)
+ for (QVector::const_iterator it = layerVector.begin();
+ it != layerVector.end(); ++it)
{
// Solo has priority over invisible (mute)
if ( (hasSolo && (*it)->isSolo()) ||
@@ -214,16 +214,16 @@ QVector MappingManager::getVisibleMappings() const
}
/// Returns true iff the mapping is visible.
-bool MappingManager::mappingIsVisible(Mapping::ptr mapping) const
+bool MappingManager::layerIsVisible(Layer::ptr layer) const
{
// Solo mappings are always visible.
- if (mapping->isSolo())
+ if (layer->isSolo())
{
return true;
}
// Non-solo invisible mappings are always invisible.
- else if (! mapping->isVisible())
+ else if (! layer->isVisible())
{
return false;
}
@@ -232,8 +232,8 @@ bool MappingManager::mappingIsVisible(Mapping::ptr mapping) const
// (which would thus make it invisible).
else
{
- for (QVector::const_iterator it = mappingVector.begin();
- it != mappingVector.end(); ++it)
+ for (QVector::const_iterator it = layerVector.begin();
+ it != layerVector.end(); ++it)
{
if ((*it)->isSolo())
{
@@ -247,63 +247,63 @@ bool MappingManager::mappingIsVisible(Mapping::ptr mapping) const
}
/// Returns the list of visible paints (ie. paints for which at least one mapping is visible).
-QVector MappingManager::getVisiblePaints() const
+QVector MappingManager::getVisibleSources() const
{
- QVector visiblePaints;
- QVector visibleMappings = getVisibleMappings();
- for (QVector::const_iterator it = visibleMappings.begin();
- it != visibleMappings.end(); ++it)
+ QVector visibleSources;
+ QVector visibleLayers = getVisibleLayers();
+ for (QVector::const_iterator it = visibleLayers.begin();
+ it != visibleLayers.end(); ++it)
{
- Paint::ptr paint((*it)->getPaint());
- if (!visiblePaints.contains(paint))
- visiblePaints.push_back(paint);
+ Source::ptr source((*it)->getSource());
+ if (!visibleSources.contains(source))
+ visibleSources.push_back(source);
}
- return visiblePaints;
+ return visibleSources;
}
-void MappingManager::reorderMappings(QVector mappingIds)
+void MappingManager::reorderLayers(QVector mappingIds)
{
// Both vector needs to have the same size.
- Q_ASSERT( mappingIds.size() == mappingVector.size() );
- mappingVector.clear();
+ Q_ASSERT( mappingIds.size() == layerVector.size() );
+ layerVector.clear();
int depth = 0;
for (QVector::iterator it = mappingIds.begin();
it != mappingIds.end(); ++it)
{
- // Uid should be a key of the mappingMap.
- Q_ASSERT( mappingMap.contains(*it) );
+ // Uid should be a key of the layerMap.
+ Q_ASSERT( layerMap.contains(*it) );
// Makes sure the uids are not repeated.
- Q_ASSERT( ! mappingVector.contains(mappingMap[*it]) );
+ Q_ASSERT( ! layerVector.contains(layerMap[*it]) );
// Adds the mapping at the right place in the vector.
- Mapping::ptr mapping = mappingMap[*it];
- mapping->setDepth(depth);
- mappingVector.push_back( mapping );
+ Layer::ptr layer = layerMap[*it];
+ layer->setDepth(depth);
+ layerVector.push_back( layer );
depth++;
}
}
-void MappingManager::updateMappingsDepths()
+void MappingManager::updateLayerDepths()
{
int depth = 0;
- for (QVector::iterator it = mappingVector.begin();
- it != mappingVector.end(); ++it)
+ for (QVector::iterator it = layerVector.begin();
+ it != layerVector.end(); ++it)
{
(*it)->setDepth(depth);
depth++;
}
}
-//bool MappingManager::removeMapping(Mapping::ptr mapping)
+//bool MappingManager::removeLayer(Layer::ptr layer)
//{
//}
void MappingManager::clearAll()
{
- paintVector.clear();
- mappingVector.clear();
- paintMap.clear();
- mappingMap.clear();
+ sourceVector.clear();
+ layerVector.clear();
+ sourceMap.clear();
+ layerMap.clear();
}
}
diff --git a/src/core/MappingManager.h b/src/core/MappingManager.h
index c8ec6414..92f0a261 100644
--- a/src/core/MappingManager.h
+++ b/src/core/MappingManager.h
@@ -25,14 +25,14 @@
#include
#include
-#include "Paint.h"
-#include "Mapping.h"
+#include "Source.h"
+#include "Layer.h"
namespace mmp {
/**
- * This is a container class for all the paints and mappings ie. the main model object that allows
- * CRUD over paints and mappings.
+ * This is a container class for all the sources and mappings ie. the main model object that allows
+ * CRUD over sources and mappings.
*/
class MappingManager
{
@@ -42,106 +42,106 @@ class MappingManager
private:
// Model elements.
- /// Container for all paints.
- QVector paintVector;
+ /// Container for all sources.
+ QVector sourceVector;
- /// Maps from uids to paints.
- QMap paintMap;
+ /// Maps from uids to sources.
+ QMap sourceMap;
/// Container for all mappings (ordered from bottom layer to top layer).
- QVector mappingVector;
+ QVector layerVector;
/// Maps from uids to mappings.
- QMap mappingMap;
+ QMap layerMap;
public:
- /// Returns the list of mappings associated with given paint.
- QMap getPaintMappings(const Paint::ptr paint) const;
+ /// Returns the list of mappings associated with given source.
+ QMap getSourceLayers(const Source::ptr source) const;
- /// Returns the list of mappings associated with given paint uid.
- QMap getPaintMappingsById(uid paintId) const;
+ /// Returns the list of mappings associated with given source uid.
+ QMap getSourceLayersById(uid sourceId) const;
- /// Adds a paint and returns its uid.
- uid addPaint(Paint::ptr paint);
+ /// Adds a source and returns its uid.
+ uid addSource(Source::ptr source);
- /// Returns the uid of a paint.
- uid getPaintId(Paint::ptr paint) const { return paintMap.key(paint); }
+ /// Returns the uid of a source.
+ uid getSourceId(Source::ptr source) const { return sourceMap.key(source); }
- /// Returns indices of paint or (-1) if not found.
- int getPaintIndex(Paint::ptr paint) const { return paintVector.lastIndexOf(paint); }
- int getPaintIndex(uint paintId) const { return getPaintIndex(paintMap[paintId]); }
+ /// Returns indices of source or (-1) if not found.
+ int getSourceIndex(Source::ptr source) const { return sourceVector.lastIndexOf(source); }
+ int getSourceIndex(uint sourceId) const { return getSourceIndex(sourceMap[sourceId]); }
- /// Removes a paint of given uid.
- bool removePaint(uid paintId);
+ /// Removes a source of given uid.
+ bool removeSource(uid sourceId);
/// DEPRECATED.
- bool replacePaintMappings(Paint::ptr oldpaint, Paint::ptr newpaint);
+ bool replaceSourceLayers(Source::ptr oldSource, Source::ptr newSource);
- /// Returns the number of paints.
- int nPaints() const { return paintVector.size(); }
+ /// Returns the number of sources.
+ int nSources() const { return sourceVector.size(); }
- /// Returns the i-th paint in the vector. Good for iterating over all paints.
- Paint::ptr getPaint(int i) { return paintVector[i]; }
+ /// Returns the i-th source in the vector. Good for iterating over all sources.
+ Source::ptr getSource(int i) { return sourceVector[i]; }
- /// Returns paint with given uid.
- Paint::ptr getPaintById(uid id) { return paintMap[id]; }
+ /// Returns source with given uid.
+ Source::ptr getSourceById(uid id) { return sourceMap[id]; }
/// Returns mapping with given name (first match).
- Paint::ptr getPaintByName(QString name);
+ Source::ptr getSourceByName(QString name);
/// Returns all mappings with given regexp.
- QVector getPaintsByNameRegExp(QString namePattern);
+ QVector getSourcesByNameRegExp(QString namePattern);
/// Get paints compatible with given mapping.
- QVector getPaintsCompatibleWith(Mapping::ptr mapping);
+ QVector getSourcesCompatibleWith(Layer::ptr mapping);
/// Adds a mapping and returns its uid.
- uid addMapping(Mapping::ptr mapping);
+ uid addLayer(Layer::ptr mapping);
/// Removes a mapping of given uid.
- bool removeMapping(uid mappingId);
+ bool removeLayer(uid mappingId);
/// Moves a mapping of given uid by a certain number of steps up or down.
- bool moveMapping(uid mappingId, int toIndex);
+ bool moveLayer(uid mappingId, int toIndex);
/// Returns the number of mappings.
- int nMappings() const { return mappingVector.size(); }
+ int nLayers() const { return layerVector.size(); }
/**
* Returns the i-th mapping in the vector. Good for iterating over all mappings. Vector is
* ordered from bottom (deepest) to top (shallowest) layer.
*/
- Mapping::ptr getMapping(int i) { return mappingVector[i]; }
+ Layer::ptr getLayer(int i) { return layerVector[i]; }
/// Returns mapping with given uid.
- Mapping::ptr getMappingById(uid id) const { return mappingMap[id]; }
+ Layer::ptr getLayerById(uid id) const { return layerMap[id]; }
/// Returns mapping with given name (first match).
- Mapping::ptr getMappingByName(QString name);
+ Layer::ptr getLayerByName(QString name);
/// Returns all mappings with given regexp.
- QVector getMappingsByNameRegExp(QString namePattern);
+ QVector getLayersByNameRegExp(QString namePattern);
/// Returns indices of mapping or (-1) if not found.
- int getMappingIndex(Mapping::ptr mapping) const { return mappingVector.lastIndexOf(mapping); }
- int getMappingIndex(uint mappingId) const { return getMappingIndex(getMappingById(mappingId)); }
+ int getLayerIndex(Layer::ptr mapping) const { return layerVector.lastIndexOf(mapping); }
+ int getLayerIndex(uint mappingId) const { return getLayerIndex(getLayerById(mappingId)); }
- int getMappingDepth(Mapping::ptr mapping) const { return -getMappingIndex(mapping); }
+ int getLayerDepth(Layer::ptr mapping) const { return -getLayerIndex(mapping); }
/// Reorders the mappings according to given list of uids. QVector needs to
- void reorderMappings(QVector mappingIds);
+ void reorderLayers(QVector mappingIds);
/// Update mapping depths after a move.
- void updateMappingsDepths();
+ void updateLayerDepths();
/// Returns the ordered list of visible mappings, using both the "visible" and "solo" properties.
- QVector getVisibleMappings() const;
+ QVector getVisibleLayers() const;
/// Returns true iff the mapping is visible.
- bool mappingIsVisible(Mapping::ptr mapping) const;
+ bool layerIsVisible(Layer::ptr mapping) const;
- /// Returns the list of visible paints (ie. paints for which at least one mapping is visible).
- QVector getVisiblePaints() const;
+ /// Returns the list of visible sources (ie. paints for which at least one mapping is visible).
+ QVector getVisibleSources() const;
void clearAll();
diff --git a/src/core/MetaObjectRegistry.h b/src/core/MetaObjectRegistry.h
index 51d13515..82bbeddc 100644
--- a/src/core/MetaObjectRegistry.h
+++ b/src/core/MetaObjectRegistry.h
@@ -47,6 +47,11 @@ class MetaObjectRegistry {
}
}
+ void addAlias(const QString& aliasClassName, const QMetaObject* metaObj)
+ {
+ metaObjectLookup[aliasClassName] = metaObj;
+ }
+
const QMetaObject* getMetaObject(QString className) const;
static MetaObjectRegistry& instance();
diff --git a/src/core/ProjectReader.cpp b/src/core/ProjectReader.cpp
index d7810501..1b2a53a6 100644
--- a/src/core/ProjectReader.cpp
+++ b/src/core/ProjectReader.cpp
@@ -73,31 +73,31 @@ void ProjectReader::parseProject(const QJsonObject& project)
QJsonArray sources = project[ProjectLabels::SOURCES].toArray();
QJsonArray layers = project[ProjectLabels::LAYERS].toArray();
- // Parse sources (formerly paints).
+ // Parse sources (formerly sources).
for (const auto& val : sources)
{
- Paint::ptr paint = parsePaint(val.toObject());
+ Source::ptr source = parseSource(val.toObject());
- if (paint.isNull())
+ if (source.isNull())
{
qDebug() << "Problem creating source." << Qt::endl;
}
else
{
- manager.addPaint(paint);
- _window->addPaintItem(paint->getId(), paint->getIcon(), paint->getName());
+ manager.addSource(source);
+ _window->addSourceItem(source->getId(), source->getIcon(), source->getName());
// Locate media file if not found
- if (paint->getSourceType() == Paint::SourceType::Video)
+ if (source->getSourceType() == Source::SourceType::Video)
{
- QSharedPointer media = qSharedPointerCast(paint);
+ QSharedPointer media = qSharedPointerCast(source);
Q_CHECK_PTR(media);
if (!_window->fileExists(media->getUri()))
media->setUri(_window->locateMediaFile(media->getUri(), false));
}
- if (paint->getSourceType() == Paint::SourceType::Image)
+ if (source->getSourceType() == Source::SourceType::Image)
{
- QSharedPointer image = qSharedPointerCast(paint);
+ QSharedPointer image = qSharedPointerCast(source);
Q_CHECK_PTR(image);
if (!_window->fileExists(image->getUri()))
image->setUri(_window->locateMediaFile(image->getUri(), true));
@@ -106,30 +106,30 @@ void ProjectReader::parseProject(const QJsonObject& project)
}
// Parse layers (formerly mappings).
- QVector allMappings;
+ QVector allLayers;
for (const auto& val : layers)
{
- Mapping::ptr mapping = parseMapping(val.toObject());
- if (mapping.isNull())
+ Layer::ptr layer = parseLayer(val.toObject());
+ if (layer.isNull())
{
qDebug() << "Problem creating layer." << Qt::endl;
}
else
{
- allMappings.push_back(mapping);
+ allLayers.push_back(layer);
}
}
// Add all mappings in reverse order.
- for (QVector::const_reverse_iterator it = allMappings.rbegin();
- it != allMappings.rend(); ++it)
+ for (QVector::const_reverse_iterator it = allLayers.rbegin();
+ it != allLayers.rend(); ++it)
{
- manager.addMapping(*it);
- _window->addMappingItem((*it)->getId());
+ manager.addLayer(*it);
+ _window->addLayerItem((*it)->getId());
}
}
-Paint::ptr ProjectReader::parsePaint(const QJsonObject& obj)
+Source::ptr ProjectReader::parseSource(const QJsonObject& obj)
{
QString className = Serializable::classNameCleanToReal(obj[ProjectLabels::CLASS_NAME].toString());
int id = obj[ProjectLabels::ID].toInt(NULL_UID);
@@ -139,27 +139,27 @@ Paint::ptr ProjectReader::parsePaint(const QJsonObject& obj)
const QMetaObject* metaObject = MetaObjectRegistry::instance().getMetaObject(className);
if (metaObject)
{
- Paint::ptr paint(qobject_cast(metaObject->newInstance(Q_ARG(int, id))));
+ Source::ptr source(qobject_cast(metaObject->newInstance(Q_ARG(int, id))));
- if (paint.isNull())
+ if (source.isNull())
{
qDebug() << QObject::tr("Problem at creation of source.") << Qt::endl;
}
else
- qDebug() << "Created new instance with id: " << paint->getId();
+ qDebug() << "Created new instance with id: " << source->getId();
- paint->read(obj);
+ source->read(obj);
- return paint;
+ return source;
}
else
{
_errorString = QObject::tr("Unable to create source of type '%1'.").arg(className);
- return Paint::ptr();
+ return Source::ptr();
}
}
-Mapping::ptr ProjectReader::parseMapping(const QJsonObject& obj)
+Layer::ptr ProjectReader::parseLayer(const QJsonObject& obj)
{
QString className = Serializable::classNameCleanToReal(obj[ProjectLabels::CLASS_NAME].toString());
int id = obj[ProjectLabels::ID].toInt(NULL_UID);
@@ -167,20 +167,20 @@ Mapping::ptr ProjectReader::parseMapping(const QJsonObject& obj)
const QMetaObject* metaObject = MetaObjectRegistry::instance().getMetaObject(className);
if (metaObject)
{
- Mapping::ptr mapping(qobject_cast(metaObject->newInstance(Q_ARG(int, id))));
- if (mapping.isNull())
+ Layer::ptr layer(qobject_cast(metaObject->newInstance(Q_ARG(int, id))));
+ if (layer.isNull())
{
qDebug() << QObject::tr("Problem at creation of layer.") << Qt::endl;
}
- mapping->read(obj);
+ layer->read(obj);
- return mapping;
+ return layer;
}
else
{
_errorString = QObject::tr("Unable to create layer of type '%1'.").arg(className);
- return Mapping::ptr();
+ return Layer::ptr();
}
}
diff --git a/src/core/ProjectReader.h b/src/core/ProjectReader.h
index 7aa40757..a3107a2c 100644
--- a/src/core/ProjectReader.h
+++ b/src/core/ProjectReader.h
@@ -23,8 +23,8 @@
#include
#include
#include "MainWindow.h"
-#include "Mapping.h"
-#include "Paint.h"
+#include "Layer.h"
+#include "Source.h"
#include "MetaObjectRegistry.h"
#include "ProjectLabels.h"
@@ -40,8 +40,8 @@ class ProjectReader
private:
void parseProject(const QJsonObject& project);
- Paint::ptr parsePaint(const QJsonObject& obj);
- Mapping::ptr parseMapping(const QJsonObject& obj);
+ Source::ptr parseSource(const QJsonObject& obj);
+ Layer::ptr parseLayer(const QJsonObject& obj);
/**
* Checks if the version attribute of the project tag matches the regex of supported versions of MapMap.
* Some older versions of MapMap might not be supported by this version.
diff --git a/src/core/ProjectWriter.cpp b/src/core/ProjectWriter.cpp
index 6eef7a1d..7917fb73 100644
--- a/src/core/ProjectWriter.cpp
+++ b/src/core/ProjectWriter.cpp
@@ -34,20 +34,20 @@ bool ProjectWriter::writeFile(QIODevice *device)
// Sources (formerly paints).
QJsonArray sources;
- for (int i=0; iwrite(source);
+ manager.getSource(i)->write(source);
sources.append(source);
}
project[ProjectLabels::SOURCES] = sources;
// Layers (formerly mappings).
QJsonArray layers;
- for (int i=0; iwrite(layer);
+ manager.getLayer(i)->write(layer);
layers.append(layer);
}
project[ProjectLabels::LAYERS] = layers;
diff --git a/src/core/ProjectWriter.h b/src/core/ProjectWriter.h
index af88fa76..b1748a17 100644
--- a/src/core/ProjectWriter.h
+++ b/src/core/ProjectWriter.h
@@ -24,8 +24,8 @@
#include
#include
#include "MappingManager.h"
-#include "Mapping.h"
-#include "Paint.h"
+#include "Layer.h"
+#include "Source.h"
#include "MainWindow.h"
#include "ProjectLabels.h"
diff --git a/src/core/Paint.cpp b/src/core/Source.cpp
similarity index 97%
rename from src/core/Paint.cpp
rename to src/core/Source.cpp
index 4ad04313..dfd670f5 100644
--- a/src/core/Paint.cpp
+++ b/src/core/Source.cpp
@@ -1,5 +1,5 @@
/*
- * Paint.cpp
+ * Source.cpp
*
* (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net
@@ -18,7 +18,7 @@
* along with this program. If not, see .
*/
-#include "Paint.h"
+#include "Source.h"
#include "VideoImpl.h"
#include "VideoPlayerImpl.h"
#include "CameraImpl.h"
@@ -30,7 +30,7 @@
namespace mmp {
-UidAllocator Paint::allocator;
+UidAllocator Source::allocator;
void Texture::update()
{
@@ -42,7 +42,7 @@ void Texture::update()
void Texture::read(const QJsonObject& obj)
{
- Paint::read(obj);
+ Source::read(obj);
if (obj.contains("x"))
setX(obj["x"].toDouble());
if (obj.contains("y"))
@@ -51,18 +51,18 @@ void Texture::read(const QJsonObject& obj)
void Texture::write(QJsonObject& obj)
{
- Paint::write(obj);
+ Source::write(obj);
obj["x"] = getX();
obj["y"] = getY();
}
-Paint::Paint(uid id)
+Source::Source(uid id)
: Element(id, &allocator),
_isPlaying(false)
{
}
-Paint::~Paint()
+Source::~Source()
{
allocator.free(getId());
}
@@ -108,7 +108,10 @@ void Image::build()
_images.clear();
for (int i = 0; i < reader.imageCount(); i++) {
QImage raw = reader.read().convertToFormat(QImage::Format_RGBA8888);
+ QT_WARNING_PUSH
+ QT_WARNING_DISABLE_DEPRECATED
_images.push_back(raw.mirrored(true, false).transformed(QTransform().rotate(180)));
+ QT_WARNING_POP
}
rewind();
diff --git a/src/core/Paint.h b/src/core/Source.h
similarity index 89%
rename from src/core/Paint.h
rename to src/core/Source.h
index 60531033..50a60ca0 100644
--- a/src/core/Paint.h
+++ b/src/core/Source.h
@@ -1,5 +1,5 @@
/*
- * Paint.h
+ * Source.h
*
* (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net
@@ -19,8 +19,8 @@
*/
-#ifndef PAINT_H_
-#define PAINT_H_
+#ifndef SOURCE_H_
+#define SOURCE_H_
#include
@@ -49,13 +49,13 @@ typedef enum {
} VideoType;
/**
- * A Paint is a style that can be applied when drawing potentially any shape.
+ * A Source is a style that can be applied when drawing potentially any shape.
*
* Defines the way to draw any shape.
- * There must be a MappingGui that implements this paint for every shape
+ * There must be a MappingGui that implements this source for every shape
* so that this shape might be drawn with it.
*/
-class Paint : public Element
+class Source : public Element
{
Q_OBJECT
@@ -65,7 +65,7 @@ class Paint : public Element
uid _id;
protected:
- Paint(uid id=NULL_UID);
+ Source(uid id=NULL_UID);
public:
@@ -73,16 +73,16 @@ class Paint : public Element
Video, Image, Color
};
- typedef QSharedPointer ptr;
+ typedef QSharedPointer ptr;
- virtual ~Paint();
+ virtual ~Source();
static const UidAllocator& getUidAllocator() { return allocator; }
/// This method should be called at each call of draw().
virtual void update() {}
- /// Is the paint currently playing?
+ /// Is the source currently playing?
virtual bool isPlaying() const { return _isPlaying; }
/// Starts playback.
@@ -116,7 +116,7 @@ class Paint : public Element
bool _isPlaying;
};
-class Color : public Paint
+class Color : public Source
{
Q_OBJECT
@@ -126,8 +126,8 @@ class Color : public Paint
QColor color;
public:
- Q_INVOKABLE Color(int id=NULL_UID) : Paint(id) {}
- Color(const QColor& color_, uid id=NULL_UID) : Paint(id), color(color_) {}
+ Q_INVOKABLE Color(int id=NULL_UID) : Source(id) {}
+ Color(const QColor& color_, uid id=NULL_UID) : Source(id), color(color_) {}
QColor getColor() const { return color; }
void setColor(const QColor& color_) { color = color_; }
@@ -142,11 +142,11 @@ class Color : public Paint
};
/**
- * Paint that uses an OpenGL texture to paint on potentially any MappingGui.
+ * Source that uses an OpenGL texture to render on potentially any MappingGui.
*
* This video texture is actually an OpenGL texture.
*/
-class Texture : public Paint
+class Texture : public Source
{
Q_OBJECT
@@ -160,7 +160,7 @@ class Texture : public Paint
mutable bool bitsChanged;
Texture(uid id=NULL_UID) :
- Paint(id),
+ Source(id),
textureId(0),
x(0),
y(0)
@@ -219,11 +219,11 @@ class Texture : public Paint
protected:
// Lists QProperties that should NOT be parsed automatically.
- virtual QList _propertiesSpecial() const { return Paint::_propertiesSpecial() << "x" << "y"; }
+ virtual QList _propertiesSpecial() const { return Source::_propertiesSpecial() << "x" << "y"; }
};
/**
- * Paint that is a Texture loaded from an image file.
+ * Source that is a Texture loaded from an image file.
*/
class Image : public Texture
{
@@ -292,7 +292,7 @@ class Image : public Texture
class VideoImpl; // forward declaration
/**
- * Paint that is a Texture retrieved via a video file.
+ * Source that is a Texture retrieved via a video file.
*/
class Video : public Texture
{
@@ -375,4 +375,4 @@ class Video : public Texture
}
-#endif /* PAINT_H_ */
+#endif /* SOURCE_H_ */
diff --git a/src/core/Util.h b/src/core/Util.h
index 6fd29ab5..651b617a 100644
--- a/src/core/Util.h
+++ b/src/core/Util.h
@@ -29,7 +29,7 @@
#include "Shapes.h"
#include "MM.h"
-#include "Paint.h"
+#include "Source.h"
#include
namespace mmp {
diff --git a/src/core/core.pri b/src/core/core.pri
index eecfdddc..8dd8355e 100644
--- a/src/core/core.pri
+++ b/src/core/core.pri
@@ -5,12 +5,12 @@ HEADERS += $$PWD/Commands.h \
$$PWD/CameraImpl.h \
$$PWD/CameraSurface.h \
$$PWD/Element.h \
- $$PWD/Mapping.h \
+ $$PWD/Layer.h \
$$PWD/MappingManager.h \
$$PWD/Maths.h \
$$PWD/MetaObjectRegistry.h \
$$PWD/MM.h \
- $$PWD/Paint.h \
+ $$PWD/Source.h \
$$PWD/ProjectLabels.h \
$$PWD/ProjectReader.h \
$$PWD/ProjectWriter.h \
@@ -24,11 +24,11 @@ SOURCES += $$PWD/Commands.cpp \
$$PWD/CameraImpl.cpp \
$$PWD/CameraSurface.cpp \
$$PWD/Element.cpp \
- $$PWD/Mapping.cpp \
+ $$PWD/Layer.cpp \
$$PWD/MappingManager.cpp \
$$PWD/MetaObjectRegistry.cpp \
$$PWD/MM.cpp \
- $$PWD/Paint.cpp \
+ $$PWD/Source.cpp \
$$PWD/ProjectLabels.cpp \
$$PWD/ProjectReader.cpp \
$$PWD/ProjectWriter.cpp \
diff --git a/src/gui/AboutDialog.cpp b/src/gui/AboutDialog.cpp
index c1dd03a0..ca13da11 100644
--- a/src/gui/AboutDialog.cpp
+++ b/src/gui/AboutDialog.cpp
@@ -75,6 +75,17 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent)
void AboutDialog::createAboutTab()
{
+ QWidget *aboutWidget = new QWidget;
+ QVBoxLayout *aboutLayout = new QVBoxLayout(aboutWidget);
+
+ // Add splash image at the top.
+ QLabel *splashLabel = new QLabel;
+ QPixmap splashPixmap(":/mapmap-splash");
+ int targetWidth = qMin(splashPixmap.width(), ABOUT_WINDOW_WIDTH - 40);
+ splashLabel->setPixmap(splashPixmap.scaledToWidth(targetWidth, Qt::SmoothTransformation));
+ splashLabel->setAlignment(Qt::AlignCenter);
+ aboutLayout->addWidget(splashLabel);
+
QTextBrowser *aboutTextBrowser = new QTextBrowser;
aboutTextBrowser->setOpenExternalLinks(true);
@@ -84,14 +95,14 @@ void AboutDialog::createAboutTab()
QString copyrightText = "" + tr("Copyright © 2013 %1.").arg(MM::COPYRIGHT_OWNERS) + "
";
// License short notice
QFile licenseShortFile(":/license-short");
- licenseShortFile.open(QIODevice::ReadOnly | QIODevice::Text);
+ (void)licenseShortFile.open(QIODevice::ReadOnly | QIODevice::Text);
QString licenseNoticeText = Qt::convertFromPlainText(QString::fromUtf8(licenseShortFile.readAll()), Qt::WhiteSpaceNormal);
// About projection mapping
QFile aboutMappingFile(":/projection-mapping");
- aboutMappingFile.open(QIODevice::ReadOnly | QIODevice::Text);
+ (void)aboutMappingFile.open(QIODevice::ReadOnly | QIODevice::Text);
QString aboutMappingText = QString::fromUtf8(aboutMappingFile.readAll());
// Visit our website for more information
- QString projectWebsiteText = "" + tr("See the ") + QString("").arg(MM::ORGANIZATION_DOMAIN) +
+ QString projectWebsiteText = "" + tr("See the ") + QString("