added a more flexible way of managing ProcEvents

modifying the global ProcEvent enum and refreshmap array is not needed
anymore. You can now register new events dynamically, using a ProcEventMapper
instance. See rtgui/localcontrast.cc for an example.

Hopefully this solves the problem of recurring merge conflicts when different
devs add different proc events
This commit is contained in:
Alberto Griggio
2017-12-19 13:46:19 +01:00
parent a2bd8acac9
commit c166e0a7ed
12 changed files with 215 additions and 23 deletions

View File

@@ -18,6 +18,7 @@
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#include "localcontrast.h"
#include "eventmapper.h"
#include <iomanip>
#include <cmath>
@@ -26,6 +27,13 @@ using namespace rtengine::procparams;
LocalContrast::LocalContrast(): FoldableToolPanel(this, "localcontrast", M("TP_LOCALCONTRAST_LABEL"), false, true)
{
auto m = ProcEventMapper::getInstance();
EvLocalContrastEnabled = m->newEvent(RGBCURVE, "HISTORY_MSG_LOCALCONTRAST_ENABLED");
EvLocalContrastRadius = m->newEvent(RGBCURVE, "HISTORY_MSG_LOCALCONTRAST_RADIUS");
EvLocalContrastAmount = m->newEvent(RGBCURVE, "HISTORY_MSG_LOCALCONTRAST_AMOUNT");
EvLocalContrastDarkness = m->newEvent(RGBCURVE, "HISTORY_MSG_LOCALCONTRAST_DARKNESS");
EvLocalContrastLightness = m->newEvent(RGBCURVE, "HISTORY_MSG_LOCALCONTRAST_LIGHTNESS");
radius = Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_RADIUS"), 3., 200., 1., 8.));
amount = Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_AMOUNT"), 0., 1., 0.01, 0.2));
darkness = Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_DARKNESS"), 0., 4., 0.1, 1.));