Review IdleRegister
(#4892)
This turns `IdleRegister::add()` into a template function to make the provided function pointers type safe. It also adds a `delete_data` parameter to manage the provided data pointer even in `destroy()`.
This commit is contained in:
parent
7038104a20
commit
5906329485
@ -50,12 +50,10 @@ struct NLParams {
|
|||||||
Glib::ustring queueErrorMessage;
|
Glib::ustring queueErrorMessage;
|
||||||
};
|
};
|
||||||
|
|
||||||
int bqnotifylistenerUI (void* data)
|
bool bqnotifylistenerUI(NLParams* params)
|
||||||
{
|
{
|
||||||
NLParams* params = static_cast<NLParams*>(data);
|
|
||||||
params->listener->queueSizeChanged (params->qsize, params->queueEmptied, params->queueError, params->queueErrorMessage);
|
params->listener->queueSizeChanged (params->qsize, params->queueEmptied, params->queueError, params->queueErrorMessage);
|
||||||
delete params;
|
return false;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -438,16 +436,12 @@ void BatchQueue::cancelItems (const std::vector<ThumbBrowserEntryBase*>& items)
|
|||||||
if (entry->thumbnail)
|
if (entry->thumbnail)
|
||||||
entry->thumbnail->imageRemovedFromQueue ();
|
entry->thumbnail->imageRemovedFromQueue ();
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func = [](BatchQueueEntry* bqe) -> bool {
|
||||||
const BatchQueueEntry* const bqe = static_cast<BatchQueueEntry*>(data);
|
|
||||||
|
|
||||||
::g_remove(bqe->savedParamsFile.c_str());
|
::g_remove(bqe->savedParamsFile.c_str());
|
||||||
delete bqe;
|
return false;
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, entry);
|
idle_register.add<BatchQueueEntry>(func, entry, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto entry : fd)
|
for (const auto entry : fd)
|
||||||
@ -608,12 +602,14 @@ void BatchQueue::setProgress(double p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// No need to acquire the GUI, setProgressUI will do it
|
// No need to acquire the GUI, setProgressUI will do it
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<BatchQueue*>(data)->redraw();
|
[](BatchQueue* bq) -> bool
|
||||||
return FALSE;
|
{
|
||||||
};
|
bq->redraw();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
idle_register.add(func, this);
|
idle_register.add<BatchQueue>(func, this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BatchQueue::setProgressStr(const Glib::ustring& str)
|
void BatchQueue::setProgressStr(const Glib::ustring& str)
|
||||||
@ -643,7 +639,7 @@ void BatchQueue::error(const Glib::ustring& descr)
|
|||||||
params->queueEmptied = false;
|
params->queueEmptied = false;
|
||||||
params->queueError = true;
|
params->queueError = true;
|
||||||
params->queueErrorMessage = descr;
|
params->queueErrorMessage = descr;
|
||||||
idle_register.add(bqnotifylistenerUI, params);
|
idle_register.add<NLParams>(bqnotifylistenerUI, params, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -985,7 +981,7 @@ void BatchQueue::notifyListener (bool queueEmptied)
|
|||||||
}
|
}
|
||||||
params->queueEmptied = queueEmptied;
|
params->queueEmptied = queueEmptied;
|
||||||
params->queueError = false;
|
params->queueError = false;
|
||||||
idle_register.add(bqnotifylistenerUI, params);
|
idle_register.add<NLParams>(bqnotifylistenerUI, params, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,13 +170,14 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr)
|
|||||||
show_all ();
|
show_all ();
|
||||||
|
|
||||||
if (batchQueue->loadBatchQueue()) {
|
if (batchQueue->loadBatchQueue()) {
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<BatchQueue*>(data)->resizeLoadedQueue();
|
[](BatchQueue* bq) -> bool
|
||||||
|
{
|
||||||
|
bq->resizeLoadedQueue();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<BatchQueue>(func, batchQueue, false, G_PRIORITY_LOW);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, batchQueue, G_PRIORITY_LOW);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -723,49 +723,51 @@ void BayerProcess::FrameCountChanged(int n, int frameNum)
|
|||||||
int n;
|
int n;
|
||||||
int frameNum;
|
int frameNum;
|
||||||
};
|
};
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
|
||||||
Data *d = static_cast<Data *>(data);
|
|
||||||
BayerProcess *me = d->me;
|
|
||||||
me->imageNumber->block (true);
|
|
||||||
int n = d->n;
|
|
||||||
int frameNum = d->frameNum;
|
|
||||||
|
|
||||||
me->imageNumber->remove_all();
|
const auto func =
|
||||||
me->imageNumber->append("1");
|
[](Data* d) -> bool
|
||||||
for(int i = 2; i <= std::min(n, 4); ++i) {
|
{
|
||||||
std::ostringstream entry;
|
BayerProcess *me = d->me;
|
||||||
entry << i;
|
me->imageNumber->block (true);
|
||||||
me->imageNumber->append(entry.str());
|
int n = d->n;
|
||||||
}
|
int frameNum = d->frameNum;
|
||||||
me->imageNumber->set_active(std::min(frameNum, n - 1));
|
|
||||||
if(n == 1) {
|
|
||||||
me->imageNumberBox->hide();
|
|
||||||
} else {
|
|
||||||
me->imageNumberBox->show();
|
|
||||||
}
|
|
||||||
me->imageNumber->block (false);
|
|
||||||
delete d;
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, n, frameNum });
|
me->imageNumber->remove_all();
|
||||||
|
me->imageNumber->append("1");
|
||||||
|
for(int i = 2; i <= std::min(n, 4); ++i) {
|
||||||
|
std::ostringstream entry;
|
||||||
|
entry << i;
|
||||||
|
me->imageNumber->append(entry.str());
|
||||||
|
}
|
||||||
|
me->imageNumber->set_active(std::min(frameNum, n - 1));
|
||||||
|
if(n == 1) {
|
||||||
|
me->imageNumberBox->hide();
|
||||||
|
} else {
|
||||||
|
me->imageNumberBox->show();
|
||||||
|
}
|
||||||
|
me->imageNumber->block (false);
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
idle_register.add<Data>(func, new Data{this, n, frameNum}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BayerProcess::autoContrastChanged (double autoContrast)
|
void BayerProcess::autoContrastChanged (double autoContrast)
|
||||||
{
|
{
|
||||||
struct Data {
|
struct Data {
|
||||||
BayerProcess *me;
|
BayerProcess* self;
|
||||||
double autoContrast;
|
double autoContrast;
|
||||||
};
|
};
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
|
||||||
Data *d = static_cast<Data *>(data);
|
|
||||||
BayerProcess *me = d->me;
|
|
||||||
me->disableListener();
|
|
||||||
me->dualDemosaicContrast->setValue(d->autoContrast);
|
|
||||||
me->enableListener();
|
|
||||||
delete d;
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, autoContrast });
|
const auto func =
|
||||||
|
[](Data* data) -> bool
|
||||||
|
{
|
||||||
|
BayerProcess* const self = data->self;
|
||||||
|
self->disableListener();
|
||||||
|
self->dualDemosaicContrast->setValue(data->autoContrast);
|
||||||
|
self->enableListener();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
idle_register.add<Data>(func, new Data{this, autoContrast}, true);
|
||||||
}
|
}
|
||||||
|
@ -375,12 +375,14 @@ void BlackWhite::BWChanged (double redbw, double greenbw, double bluebw)
|
|||||||
nextgreenbw = greenbw;
|
nextgreenbw = greenbw;
|
||||||
nextbluebw = bluebw;
|
nextbluebw = bluebw;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<BlackWhite*>(data)->BWComputed_();
|
[](BlackWhite* self) -> bool
|
||||||
return FALSE;
|
{
|
||||||
};
|
self->BWComputed_();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
idle_register.add(func, this);
|
idle_register.add<BlackWhite>(func, this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackWhite::BWComputed_ ()
|
bool BlackWhite::BWComputed_ ()
|
||||||
|
@ -1452,63 +1452,63 @@ void ColorAppearance::setDefaults (const ProcParams* defParams, const ParamsEdit
|
|||||||
void ColorAppearance::autoCamChanged (double ccam, double ccamout)
|
void ColorAppearance::autoCamChanged (double ccam, double ccamout)
|
||||||
{
|
{
|
||||||
struct Data {
|
struct Data {
|
||||||
ColorAppearance *me;
|
ColorAppearance* me;
|
||||||
double ccam;
|
double ccam;
|
||||||
double ccamout;
|
double ccamout;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Data *d = static_cast<Data *>(data);
|
[](Data* data) -> bool
|
||||||
ColorAppearance *me = d->me;
|
{
|
||||||
me->disableListener();
|
ColorAppearance* const self = data->me;
|
||||||
me->degree->setValue(d->ccam);
|
self->disableListener();
|
||||||
me->degreeout->setValue(d->ccamout);
|
self->degree->setValue(data->ccam);
|
||||||
me->enableListener();
|
self->degreeout->setValue(data->ccamout);
|
||||||
delete d;
|
self->enableListener();
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, ccam, ccamout });
|
idle_register.add<Data>(func, new Data{this, ccam, ccamout}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorAppearance::adapCamChanged (double cadap)
|
void ColorAppearance::adapCamChanged (double cadap)
|
||||||
{
|
{
|
||||||
struct Data {
|
struct Data {
|
||||||
ColorAppearance *me;
|
ColorAppearance* self;
|
||||||
double cadap;
|
double cadap;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Data *d = static_cast<Data *>(data);
|
[](Data* data) -> bool
|
||||||
ColorAppearance *me = d->me;
|
{
|
||||||
me->disableListener();
|
ColorAppearance* const self = data->self;
|
||||||
me->adapscen->setValue(d->cadap);
|
self->disableListener();
|
||||||
me->enableListener();
|
self->adapscen->setValue(data->cadap);
|
||||||
delete d;
|
self->enableListener();
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, cadap });
|
idle_register.add<Data>(func, new Data{this, cadap}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorAppearance::ybCamChanged (int ybsc)
|
void ColorAppearance::ybCamChanged (int ybsc)
|
||||||
{
|
{
|
||||||
struct Data {
|
struct Data {
|
||||||
ColorAppearance *me;
|
ColorAppearance* self;
|
||||||
int ybsc;
|
int ybsc;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Data *d = static_cast<Data *>(data);
|
[](Data* data) -> bool
|
||||||
ColorAppearance *me = d->me;
|
{
|
||||||
me->disableListener();
|
ColorAppearance* self = data->self;
|
||||||
me->ybscen->setValue(d->ybsc);
|
self->disableListener();
|
||||||
me->enableListener();
|
self->ybscen->setValue(data->ybsc);
|
||||||
delete d;
|
self->enableListener();
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, ybsc });
|
idle_register.add<Data>(func, new Data{this, ybsc}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorAppearance::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller)
|
void ColorAppearance::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller)
|
||||||
|
@ -689,24 +689,24 @@ void ColorToning::setAdjusterBehavior (bool splitAdd, bool satThresholdAdd, bool
|
|||||||
|
|
||||||
void ColorToning::autoColorTonChanged(int satthres, int satprot)
|
void ColorToning::autoColorTonChanged(int satthres, int satprot)
|
||||||
{
|
{
|
||||||
struct Data {
|
struct Data {
|
||||||
ColorToning *me;
|
ColorToning *self;
|
||||||
int satthres;
|
int satthres;
|
||||||
int satprot;
|
int satprot;
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto func =
|
||||||
|
[](Data* data) -> bool
|
||||||
|
{
|
||||||
|
ColorToning* const self = data->self;
|
||||||
|
self->disableListener();
|
||||||
|
self->satProtectionThreshold->setValue(data->satthres);
|
||||||
|
self->saturatedOpacity->setValue(data->satprot);
|
||||||
|
self->enableListener();
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
idle_register.add<Data>(func, new Data{this, satthres, satprot}, true);
|
||||||
Data *d = static_cast<Data *>(data);
|
|
||||||
ColorToning *me = d->me;
|
|
||||||
me->disableListener();
|
|
||||||
me->satProtectionThreshold->setValue(d->satthres);
|
|
||||||
me->saturatedOpacity->setValue(d->satprot);
|
|
||||||
me->enableListener ();
|
|
||||||
delete d;
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, satthres, satprot });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorToning::adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop)
|
void ColorToning::adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop)
|
||||||
|
@ -38,18 +38,16 @@ public:
|
|||||||
: crop(_crop), notify(_notify) {}
|
: crop(_crop), notify(_notify) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
int refreshSpinsUI (void* data)
|
bool refreshSpinsUI(RefreshSpinHelper* rsh)
|
||||||
{
|
{
|
||||||
RefreshSpinHelper* rsh = static_cast<RefreshSpinHelper*>(data);
|
rsh->crop->refreshSpins(rsh->notify);
|
||||||
rsh->crop->refreshSpins (rsh->notify);
|
return false;
|
||||||
delete rsh;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int notifyListenerUI (void* data)
|
bool notifyListenerUI(Crop* self)
|
||||||
{
|
{
|
||||||
static_cast<Crop*>(data)->notifyListener();
|
self->notifyListener();
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -515,16 +513,14 @@ void Crop::enabledChanged ()
|
|||||||
|
|
||||||
void Crop::hFlipCrop ()
|
void Crop::hFlipCrop ()
|
||||||
{
|
{
|
||||||
|
|
||||||
nx = maxw - nx - nw;
|
nx = maxw - nx - nw;
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::vFlipCrop ()
|
void Crop::vFlipCrop ()
|
||||||
{
|
{
|
||||||
|
|
||||||
ny = maxh - ny - nh;
|
ny = maxh - ny - nh;
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::rotateCrop (int deg, bool hflip, bool vflip)
|
void Crop::rotateCrop (int deg, bool hflip, bool vflip)
|
||||||
@ -564,7 +560,7 @@ void Crop::rotateCrop (int deg, bool hflip, bool vflip)
|
|||||||
}
|
}
|
||||||
|
|
||||||
lastRotationDeg = deg;
|
lastRotationDeg = deg;
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::positionChanged ()
|
void Crop::positionChanged ()
|
||||||
@ -578,7 +574,7 @@ void Crop::positionChanged ()
|
|||||||
int W = nw;
|
int W = nw;
|
||||||
int H = nh;
|
int H = nh;
|
||||||
cropMoved (X, Y, W, H);
|
cropMoved (X, Y, W, H);
|
||||||
idle_register.add(notifyListenerUI, this);
|
idle_register.add<Crop>(notifyListenerUI, this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::widthChanged ()
|
void Crop::widthChanged ()
|
||||||
@ -591,7 +587,7 @@ void Crop::widthChanged ()
|
|||||||
int W = (int)w->get_value ();
|
int W = (int)w->get_value ();
|
||||||
int H = nh;
|
int H = nh;
|
||||||
cropWidth2Resized (X, Y, W, H);
|
cropWidth2Resized (X, Y, W, H);
|
||||||
idle_register.add(notifyListenerUI, this);
|
idle_register.add<Crop>(notifyListenerUI, this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::heightChanged ()
|
void Crop::heightChanged ()
|
||||||
@ -604,7 +600,7 @@ void Crop::heightChanged ()
|
|||||||
int W = nw;
|
int W = nw;
|
||||||
int H = (int)h->get_value ();
|
int H = (int)h->get_value ();
|
||||||
cropHeight2Resized (X, Y, W, H);
|
cropHeight2Resized (X, Y, W, H);
|
||||||
idle_register.add(notifyListenerUI, this);
|
idle_register.add<Crop>(notifyListenerUI, this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fixed ratio toggle button
|
// Fixed ratio toggle button
|
||||||
@ -656,7 +652,7 @@ void Crop::adjustCropToRatio()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This will save the options
|
// This will save the options
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, true));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, true), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::refreshSize ()
|
void Crop::refreshSize ()
|
||||||
@ -742,14 +738,14 @@ void Crop::sizeChanged(int x, int y, int ow, int oh)
|
|||||||
y
|
y
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Params* const params = static_cast<Params*>(data);
|
[](Params* params) -> bool
|
||||||
params->crop->setDimensions(params->x, params->y);
|
{
|
||||||
delete params;
|
params->crop->setDimensions(params->x, params->y);
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, params);
|
idle_register.add<Params>(func, params, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Crop::refreshSpins (bool notify)
|
bool Crop::refreshSpins (bool notify)
|
||||||
@ -813,7 +809,7 @@ void Crop::cropMoved (int &X, int &Y, int &W, int &H)
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins));
|
// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -857,7 +853,7 @@ void Crop::cropWidth1Resized (int &X, int &Y, int &W, int &H, float custom_ratio
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropWidth2Resized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
void Crop::cropWidth2Resized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
||||||
@ -897,7 +893,7 @@ void Crop::cropWidth2Resized (int &X, int &Y, int &W, int &H, float custom_ratio
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropHeight1Resized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
void Crop::cropHeight1Resized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
||||||
@ -940,7 +936,7 @@ void Crop::cropHeight1Resized (int &X, int &Y, int &W, int &H, float custom_rati
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropHeight2Resized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
void Crop::cropHeight2Resized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
||||||
@ -980,7 +976,7 @@ void Crop::cropHeight2Resized (int &X, int &Y, int &W, int &H, float custom_rati
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropTopLeftResized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
void Crop::cropTopLeftResized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
||||||
@ -1022,7 +1018,7 @@ void Crop::cropTopLeftResized (int &X, int &Y, int &W, int &H, float custom_rati
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropTopRightResized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
void Crop::cropTopRightResized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
||||||
@ -1062,7 +1058,7 @@ void Crop::cropTopRightResized (int &X, int &Y, int &W, int &H, float custom_rat
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropBottomLeftResized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
void Crop::cropBottomLeftResized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
||||||
@ -1102,7 +1098,7 @@ void Crop::cropBottomLeftResized (int &X, int &Y, int &W, int &H, float custom_r
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropBottomRightResized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
void Crop::cropBottomRightResized (int &X, int &Y, int &W, int &H, float custom_ratio)
|
||||||
@ -1139,7 +1135,7 @@ void Crop::cropBottomRightResized (int &X, int &Y, int &W, int &H, float custom_
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropInit (int &x, int &y, int &w, int &h)
|
void Crop::cropInit (int &x, int &y, int &w, int &h)
|
||||||
@ -1253,12 +1249,12 @@ void Crop::cropResized (int &x, int &y, int& x2, int& y2)
|
|||||||
nw = W;
|
nw = W;
|
||||||
nh = H;
|
nh = H;
|
||||||
|
|
||||||
idle_register.add(refreshSpinsUI, new RefreshSpinHelper(this, false));
|
idle_register.add<RefreshSpinHelper>(refreshSpinsUI, new RefreshSpinHelper(this, false), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crop::cropManipReady ()
|
void Crop::cropManipReady ()
|
||||||
{
|
{
|
||||||
idle_register.add(notifyListenerUI, this);
|
idle_register.add<Crop>(notifyListenerUI, this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
double Crop::getRatio () const
|
double Crop::getRatio () const
|
||||||
|
@ -338,9 +338,9 @@ void CropHandler::setDetailedCrop(
|
|||||||
bool expected = false;
|
bool expected = false;
|
||||||
|
|
||||||
if (redraw_needed.compare_exchange_strong(expected, true)) {
|
if (redraw_needed.compare_exchange_strong(expected, true)) {
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
CropHandler* const self = static_cast<CropHandler*>(data);
|
[](CropHandler* self) -> bool
|
||||||
|
{
|
||||||
self->cimg.lock ();
|
self->cimg.lock ();
|
||||||
|
|
||||||
if (self->redraw_needed.exchange(false)) {
|
if (self->redraw_needed.exchange(false)) {
|
||||||
@ -350,7 +350,7 @@ void CropHandler::setDetailedCrop(
|
|||||||
self->cropimg.clear();
|
self->cropimg.clear();
|
||||||
self->cropimgtrue.clear();
|
self->cropimgtrue.clear();
|
||||||
self->cimg.unlock ();
|
self->cimg.unlock ();
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!self->cropimg.empty()) {
|
if (!self->cropimg.empty()) {
|
||||||
@ -398,10 +398,10 @@ void CropHandler::setDetailedCrop(
|
|||||||
self->cimg.unlock();
|
self->cimg.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, this/*, G_PRIORITY_HIGH_IDLE*/);
|
idle_register.add<CropHandler>(func, this, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,32 +284,32 @@ DirPyrDenoise::~DirPyrDenoise ()
|
|||||||
void DirPyrDenoise::chromaChanged (double autchroma, double autred, double autblue)
|
void DirPyrDenoise::chromaChanged (double autchroma, double autred, double autblue)
|
||||||
{
|
{
|
||||||
struct Data {
|
struct Data {
|
||||||
DirPyrDenoise *me;
|
DirPyrDenoise* self;
|
||||||
double autchroma;
|
double autchroma;
|
||||||
double autred;
|
double autred;
|
||||||
double autblue;
|
double autblue;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Data *d = static_cast<Data *>(data);
|
[](Data* data) -> bool
|
||||||
DirPyrDenoise *me = d->me;
|
{
|
||||||
me->disableListener();
|
DirPyrDenoise* const self = data->self;
|
||||||
me->chroma->setValue(d->autchroma);
|
self->disableListener();
|
||||||
me->redchro->setValue(d->autred);
|
self->chroma->setValue(data->autchroma);
|
||||||
me->bluechro->setValue(d->autblue);
|
self->redchro->setValue(data->autred);
|
||||||
me->enableListener();
|
self->bluechro->setValue(data->autblue);
|
||||||
delete d;
|
self->enableListener();
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, autchroma, autred, autblue });
|
idle_register.add<Data>(func, new Data{this, autchroma, autred, autblue}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirPyrDenoise::noiseTilePrev (int tileX, int tileY, int prevX, int prevY, int sizeT, int sizeP)
|
void DirPyrDenoise::noiseTilePrev (int tileX, int tileY, int prevX, int prevY, int sizeT, int sizeP)
|
||||||
{
|
{
|
||||||
if (!batchMode) {
|
if (!batchMode) {
|
||||||
struct Data {
|
struct Data {
|
||||||
DirPyrDenoise *me;
|
DirPyrDenoise* self;
|
||||||
int tileX;
|
int tileX;
|
||||||
int tileY;
|
int tileY;
|
||||||
int prevX;
|
int prevX;
|
||||||
@ -318,26 +318,26 @@ void DirPyrDenoise::noiseTilePrev (int tileX, int tileY, int prevX, int prevY, i
|
|||||||
int sizeP;
|
int sizeP;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Data *d = static_cast<Data *>(data);
|
[](Data* data) -> bool
|
||||||
DirPyrDenoise *me = d->me;
|
{
|
||||||
me->TileLabels->set_text(
|
DirPyrDenoise* self = data->self;
|
||||||
Glib::ustring::compose(M("TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_TILEINFO"),
|
self->TileLabels->set_text(
|
||||||
Glib::ustring::format(std::fixed, std::setprecision(0), d->sizeT),
|
Glib::ustring::compose(M("TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_TILEINFO"),
|
||||||
Glib::ustring::format(std::fixed, std::setprecision(0), d->tileX),
|
Glib::ustring::format(std::fixed, std::setprecision(0), data->sizeT),
|
||||||
Glib::ustring::format(std::fixed, std::setprecision(0), d->tileY))
|
Glib::ustring::format(std::fixed, std::setprecision(0), data->tileX),
|
||||||
);
|
Glib::ustring::format(std::fixed, std::setprecision(0), data->tileY))
|
||||||
me->PrevLabels->set_text(
|
);
|
||||||
Glib::ustring::compose(M("TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_INFO"),
|
self->PrevLabels->set_text(
|
||||||
Glib::ustring::format(std::fixed, std::setprecision(0), d->sizeP),
|
Glib::ustring::compose(M("TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_INFO"),
|
||||||
Glib::ustring::format(std::fixed, std::setprecision(0), d->prevX),
|
Glib::ustring::format(std::fixed, std::setprecision(0), data->sizeP),
|
||||||
Glib::ustring::format(std::fixed, std::setprecision(0), d->prevY))
|
Glib::ustring::format(std::fixed, std::setprecision(0), data->prevX),
|
||||||
);
|
Glib::ustring::format(std::fixed, std::setprecision(0), data->prevY))
|
||||||
delete d;
|
);
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, tileX, tileY, prevX, prevY, sizeT, sizeP });
|
idle_register.add<Data>(func, new Data{this, tileX, tileY, prevX, prevY, sizeT, sizeP}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,20 +345,20 @@ void DirPyrDenoise::noiseChanged (double nresid, double highresid)
|
|||||||
{
|
{
|
||||||
if (!batchMode) {
|
if (!batchMode) {
|
||||||
struct Data {
|
struct Data {
|
||||||
DirPyrDenoise *me;
|
DirPyrDenoise* self;
|
||||||
double nresid;
|
double nresid;
|
||||||
double highresid;
|
double highresid;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Data *d = static_cast<Data *>(data);
|
[](Data* data) -> bool
|
||||||
DirPyrDenoise *me = d->me;
|
{
|
||||||
me->updateNoiseLabel(d->nresid, d->highresid);
|
DirPyrDenoise* const self = data->self;
|
||||||
delete d;
|
self->updateNoiseLabel(data->nresid, data->highresid);
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, nresid, highresid });
|
idle_register.add<Data>(func, new Data{this, nresid, highresid}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,10 +45,8 @@ struct spparams {
|
|||||||
Glib::RefPtr<Gtk::CssProvider> cssProvider;
|
Glib::RefPtr<Gtk::CssProvider> cssProvider;
|
||||||
};
|
};
|
||||||
|
|
||||||
int setprogressStrUI ( void *p )
|
bool setprogressStrUI(spparams* s)
|
||||||
{
|
{
|
||||||
spparams *s = static_cast<spparams*> (p);
|
|
||||||
|
|
||||||
if ( ! s->str.empty() ) {
|
if ( ! s->str.empty() ) {
|
||||||
s->pProgress->set_text ( M (s->str) );
|
s->pProgress->set_text ( M (s->str) );
|
||||||
}
|
}
|
||||||
@ -67,8 +65,7 @@ int setprogressStrUI ( void *p )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete s;
|
return false;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -498,7 +495,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
|
|||||||
|
|
||||||
// build left side panel
|
// build left side panel
|
||||||
leftbox = new Gtk::Paned (Gtk::ORIENTATION_VERTICAL);
|
leftbox = new Gtk::Paned (Gtk::ORIENTATION_VERTICAL);
|
||||||
|
|
||||||
// make a subbox to allow resizing of the histogram (if it's on the left)
|
// make a subbox to allow resizing of the histogram (if it's on the left)
|
||||||
leftsubbox = new Gtk::Box (Gtk::ORIENTATION_VERTICAL);
|
leftsubbox = new Gtk::Box (Gtk::ORIENTATION_VERTICAL);
|
||||||
leftsubbox->set_size_request (230, 250);
|
leftsubbox->set_size_request (230, 250);
|
||||||
@ -520,7 +517,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
|
|||||||
leftsubbox->pack_start (*history);
|
leftsubbox->pack_start (*history);
|
||||||
|
|
||||||
leftsubbox->show_all ();
|
leftsubbox->show_all ();
|
||||||
|
|
||||||
leftbox->pack2 (*leftsubbox, true, true);
|
leftbox->pack2 (*leftsubbox, true, true);
|
||||||
leftbox->show_all ();
|
leftbox->show_all ();
|
||||||
|
|
||||||
@ -638,14 +635,14 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
|
|||||||
|
|
||||||
// build right side panel
|
// build right side panel
|
||||||
vboxright = new Gtk::Paned (Gtk::ORIENTATION_VERTICAL);
|
vboxright = new Gtk::Paned (Gtk::ORIENTATION_VERTICAL);
|
||||||
|
|
||||||
vsubboxright = new Gtk::Box (Gtk::ORIENTATION_VERTICAL, 0);
|
vsubboxright = new Gtk::Box (Gtk::ORIENTATION_VERTICAL, 0);
|
||||||
vsubboxright->set_size_request (300, 250);
|
vsubboxright->set_size_request (300, 250);
|
||||||
|
|
||||||
vsubboxright->pack_start (*ppframe, Gtk::PACK_SHRINK, 2);
|
vsubboxright->pack_start (*ppframe, Gtk::PACK_SHRINK, 2);
|
||||||
// main notebook
|
// main notebook
|
||||||
vsubboxright->pack_start (*tpc->toolPanelNotebook);
|
vsubboxright->pack_start (*tpc->toolPanelNotebook);
|
||||||
|
|
||||||
vboxright->pack2 (*vsubboxright, true, true);
|
vboxright->pack2 (*vsubboxright, true, true);
|
||||||
|
|
||||||
// Save buttons
|
// Save buttons
|
||||||
@ -862,7 +859,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
|
|||||||
if (tbTopPanel_1) {
|
if (tbTopPanel_1) {
|
||||||
tbTopPanel_1->signal_toggled().connect ( sigc::mem_fun (*this, &EditorPanel::tbTopPanel_1_toggled) );
|
tbTopPanel_1->signal_toggled().connect ( sigc::mem_fun (*this, &EditorPanel::tbTopPanel_1_toggled) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorPanel::~EditorPanel ()
|
EditorPanel::~EditorPanel ()
|
||||||
@ -1192,7 +1189,7 @@ void EditorPanel::setProgress(double p)
|
|||||||
spparams *s = new spparams;
|
spparams *s = new spparams;
|
||||||
s->val = p;
|
s->val = p;
|
||||||
s->pProgress = progressLabel;
|
s->pProgress = progressLabel;
|
||||||
idle_register.add(setprogressStrUI, s);
|
idle_register.add<spparams>(setprogressStrUI, s, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorPanel::setProgressStr(const Glib::ustring& str)
|
void EditorPanel::setProgressStr(const Glib::ustring& str)
|
||||||
@ -1201,7 +1198,7 @@ void EditorPanel::setProgressStr(const Glib::ustring& str)
|
|||||||
s->str = str;
|
s->str = str;
|
||||||
s->val = -1;
|
s->val = -1;
|
||||||
s->pProgress = progressLabel;
|
s->pProgress = progressLabel;
|
||||||
idle_register.add(setprogressStrUI, s);
|
idle_register.add<spparams>(setprogressStrUI, s, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorPanel::setProgressState(bool inProcessing)
|
void EditorPanel::setProgressState(bool inProcessing)
|
||||||
@ -1217,30 +1214,27 @@ void EditorPanel::setProgressState(bool inProcessing)
|
|||||||
p->inProcessing = inProcessing;
|
p->inProcessing = inProcessing;
|
||||||
p->epih = epih;
|
p->epih = epih;
|
||||||
|
|
||||||
const auto func = [] (gpointer data) -> gboolean {
|
const auto func =
|
||||||
spsparams* const p = static_cast<spsparams*> (data);
|
[](spsparams* p) -> bool
|
||||||
|
|
||||||
if (p->epih->destroyed)
|
|
||||||
{
|
{
|
||||||
if (p->epih->pending == 1) {
|
if (p->epih->destroyed)
|
||||||
delete p->epih;
|
{
|
||||||
} else {
|
if (p->epih->pending == 1) {
|
||||||
p->epih->pending--;
|
delete p->epih;
|
||||||
|
} else {
|
||||||
|
p->epih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete p;
|
p->epih->epanel->refreshProcessingState (p->inProcessing);
|
||||||
|
p->epih->pending--;
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
p->epih->epanel->refreshProcessingState (p->inProcessing);
|
idle_register.add<spsparams>(func, p, true);
|
||||||
p->epih->pending--;
|
|
||||||
delete p;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add (func, p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorPanel::error(const Glib::ustring& descr)
|
void EditorPanel::error(const Glib::ustring& descr)
|
||||||
@ -1261,30 +1255,27 @@ void EditorPanel::error(const Glib::ustring& title, const Glib::ustring& descr)
|
|||||||
p->title = title;
|
p->title = title;
|
||||||
p->epih = epih;
|
p->epih = epih;
|
||||||
|
|
||||||
const auto func = [] (gpointer data) -> gboolean {
|
const auto func =
|
||||||
errparams* const p = static_cast<errparams*> (data);
|
[](errparams* p) -> bool
|
||||||
|
|
||||||
if (p->epih->destroyed)
|
|
||||||
{
|
{
|
||||||
if (p->epih->pending == 1) {
|
if (p->epih->destroyed)
|
||||||
delete p->epih;
|
{
|
||||||
} else {
|
if (p->epih->pending == 1) {
|
||||||
p->epih->pending--;
|
delete p->epih;
|
||||||
|
} else {
|
||||||
|
p->epih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete p;
|
p->epih->epanel->displayError (p->title, p->descr);
|
||||||
|
p->epih->pending--;
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
p->epih->epanel->displayError (p->title, p->descr);
|
idle_register.add<errparams>(func, p, true);
|
||||||
p->epih->pending--;
|
|
||||||
delete p;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add (func, p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorPanel::displayError(const Glib::ustring& title, const Glib::ustring& descr)
|
void EditorPanel::displayError(const Glib::ustring& title, const Glib::ustring& descr)
|
||||||
@ -2376,7 +2367,7 @@ void EditorPanel::updateHistogramPosition (int oldPosition, int newPosition)
|
|||||||
leftbox->pack1(*histogramPanel, false, false);
|
leftbox->pack1(*histogramPanel, false, false);
|
||||||
histogramPanel->unreference();
|
histogramPanel->unreference();
|
||||||
}
|
}
|
||||||
|
|
||||||
leftbox->set_position(options.histogramHeight);
|
leftbox->set_position(options.histogramHeight);
|
||||||
histogramPanel->reorder (Gtk::POS_LEFT);
|
histogramPanel->reorder (Gtk::POS_LEFT);
|
||||||
break;
|
break;
|
||||||
@ -2396,14 +2387,14 @@ void EditorPanel::updateHistogramPosition (int oldPosition, int newPosition)
|
|||||||
vboxright->pack1 (*histogramPanel, false, false);
|
vboxright->pack1 (*histogramPanel, false, false);
|
||||||
histogramPanel->unreference();
|
histogramPanel->unreference();
|
||||||
}
|
}
|
||||||
|
|
||||||
vboxright->set_position(options.histogramHeight);
|
vboxright->set_position(options.histogramHeight);
|
||||||
histogramPanel->reorder (Gtk::POS_RIGHT);
|
histogramPanel->reorder (Gtk::POS_RIGHT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
iareapanel->imageArea->setPointerMotionHListener (histogramPanel);
|
iareapanel->imageArea->setPointerMotionHListener (histogramPanel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -568,31 +568,30 @@ void FileBrowser::doubleClicked (ThumbBrowserEntryBase* entry)
|
|||||||
void FileBrowser::addEntry (FileBrowserEntry* entry)
|
void FileBrowser::addEntry (FileBrowserEntry* entry)
|
||||||
{
|
{
|
||||||
struct addparams {
|
struct addparams {
|
||||||
FileBrowser *browser;
|
FileBrowser* self;
|
||||||
FileBrowserEntry *entry;
|
FileBrowserEntry* entry;
|
||||||
unsigned int session_id;
|
unsigned int session_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
addparams* const ap = new addparams;
|
addparams* const ap = new addparams;
|
||||||
entry->setParent (this);
|
entry->setParent (this);
|
||||||
ap->browser = this;
|
ap->self = this;
|
||||||
ap->entry = entry;
|
ap->entry = entry;
|
||||||
ap->session_id = session_id();
|
ap->session_id = session_id();
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
addparams* const ap = static_cast<addparams*>(data);
|
[](addparams* ap) -> bool
|
||||||
if (ap->session_id != ap->browser->session_id()) {
|
{
|
||||||
delete ap->entry;
|
if (ap->session_id != ap->self->session_id()) {
|
||||||
delete ap;
|
delete ap->entry;
|
||||||
} else {
|
} else {
|
||||||
ap->browser->addEntry_(ap->entry);
|
ap->self->addEntry_(ap->entry);
|
||||||
delete ap;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, ap);
|
idle_register.add<addparams>(func, ap, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileBrowser::addEntry_ (FileBrowserEntry* entry)
|
void FileBrowser::addEntry_ (FileBrowserEntry* entry)
|
||||||
@ -1935,13 +1934,14 @@ void FileBrowser::_thumbRearrangementNeeded ()
|
|||||||
|
|
||||||
void FileBrowser::thumbRearrangementNeeded ()
|
void FileBrowser::thumbRearrangementNeeded ()
|
||||||
{
|
{
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<FileBrowser*>(data)->_thumbRearrangementNeeded();
|
[](FileBrowser* self) -> bool
|
||||||
|
{
|
||||||
|
self->_thumbRearrangementNeeded();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<FileBrowser>(func, this, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileBrowser::selectionChanged ()
|
void FileBrowser::selectionChanged ()
|
||||||
|
@ -233,31 +233,29 @@ void FileBrowserEntry::updateImage(rtengine::IImage8* img, double scale, const r
|
|||||||
|
|
||||||
const gint priority = G_PRIORITY_LOW;
|
const gint priority = G_PRIORITY_LOW;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
tiupdate* const params = static_cast<tiupdate*>(data);
|
[](tiupdate* params) -> bool
|
||||||
FileBrowserEntryIdleHelper* const feih = params->feih;
|
{
|
||||||
|
FileBrowserEntryIdleHelper* const feih = params->feih;
|
||||||
|
|
||||||
if (feih->destroyed) {
|
if (feih->destroyed) {
|
||||||
if (feih->pending == 1) {
|
if (feih->pending == 1) {
|
||||||
delete feih;
|
delete feih;
|
||||||
} else {
|
} else {
|
||||||
feih->pending--;
|
feih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
|
params->img->free ();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
params->img->free ();
|
feih->fbentry->_updateImage (params->img, params->scale, params->cropParams);
|
||||||
delete params;
|
feih->pending--;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
feih->fbentry->_updateImage (params->img, params->scale, params->cropParams);
|
return false;
|
||||||
feih->pending--;
|
};
|
||||||
|
|
||||||
delete params;
|
idle_register.add<tiupdate>(func, param, true, priority);
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, param, priority);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileBrowserEntry::_updateImage(rtengine::IImage8* img, double s, const rtengine::procparams::CropParams& cropParams)
|
void FileBrowserEntry::_updateImage(rtengine::IImage8* img, double s, const rtengine::procparams::CropParams& cropParams)
|
||||||
|
@ -873,13 +873,14 @@ void FileCatalog::previewsFinished (int dir_id)
|
|||||||
currentEFS = dirEFS;
|
currentEFS = dirEFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<FileCatalog*>(data)->previewsFinishedUI();
|
[](FileCatalog* self) -> bool
|
||||||
|
{
|
||||||
|
self->previewsFinishedUI();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<FileCatalog>(func, this, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileCatalog::setEnabled (bool e)
|
void FileCatalog::setEnabled (bool e)
|
||||||
@ -941,24 +942,22 @@ struct FCOIParams {
|
|||||||
std::vector<Thumbnail*> tmb;
|
std::vector<Thumbnail*> tmb;
|
||||||
};
|
};
|
||||||
|
|
||||||
int openRequestedUI (void* p)
|
bool openRequestedUI(FCOIParams* params)
|
||||||
{
|
{
|
||||||
FCOIParams* params = static_cast<FCOIParams*>(p);
|
|
||||||
params->catalog->_openImage (params->tmb);
|
params->catalog->_openImage (params->tmb);
|
||||||
delete params;
|
return false;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileCatalog::filterApplied()
|
void FileCatalog::filterApplied()
|
||||||
{
|
{
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<FileCatalog*>(data)->_refreshProgressBar();
|
[](FileCatalog* self) -> bool
|
||||||
|
{
|
||||||
|
self->_refreshProgressBar();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<FileCatalog>(func, this, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileCatalog::openRequested(const std::vector<Thumbnail*>& tmb)
|
void FileCatalog::openRequested(const std::vector<Thumbnail*>& tmb)
|
||||||
@ -971,7 +970,7 @@ void FileCatalog::openRequested(const std::vector<Thumbnail*>& tmb)
|
|||||||
tmb[i]->increaseRef ();
|
tmb[i]->increaseRef ();
|
||||||
}
|
}
|
||||||
|
|
||||||
idle_register.add(openRequestedUI, params);
|
idle_register.add<FCOIParams>(openRequestedUI, params, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileCatalog::deleteRequested(const std::vector<FileBrowserEntry*>& tbe, bool inclBatchProcessed)
|
void FileCatalog::deleteRequested(const std::vector<FileBrowserEntry*>& tbe, bool inclBatchProcessed)
|
||||||
@ -1229,7 +1228,7 @@ void FileCatalog::developRequested(const std::vector<FileBrowserEntry*>& tbe, bo
|
|||||||
params.resize.width = options.fastexport_resize_width;
|
params.resize.width = options.fastexport_resize_width;
|
||||||
params.resize.height = options.fastexport_resize_height;
|
params.resize.height = options.fastexport_resize_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
params.resize.enabled = options.fastexport_resize_enabled;
|
params.resize.enabled = options.fastexport_resize_enabled;
|
||||||
params.resize.scale = options.fastexport_resize_scale;
|
params.resize.scale = options.fastexport_resize_scale;
|
||||||
params.resize.appliesTo = options.fastexport_resize_appliesTo;
|
params.resize.appliesTo = options.fastexport_resize_appliesTo;
|
||||||
@ -1903,7 +1902,7 @@ void FileCatalog::addAndOpenFile (const Glib::ustring& fname)
|
|||||||
params->catalog = this;
|
params->catalog = this;
|
||||||
params->tmb.push_back (tmb);
|
params->tmb.push_back (tmb);
|
||||||
tmb->increaseRef ();
|
tmb->increaseRef ();
|
||||||
idle_register.add(openRequestedUI, params);
|
idle_register.add<FCOIParams>(openRequestedUI, params, true);
|
||||||
|
|
||||||
} catch(Gio::Error&) {}
|
} catch(Gio::Error&) {}
|
||||||
}
|
}
|
||||||
|
@ -139,12 +139,14 @@ FilePanel::FilePanel () : parent(nullptr), error(0)
|
|||||||
|
|
||||||
fileCatalog->setFileSelectionListener (this);
|
fileCatalog->setFileSelectionListener (this);
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<FilePanel*>(data)->init();
|
[](FilePanel* self) -> bool
|
||||||
return FALSE;
|
{
|
||||||
};
|
self->init();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
idle_register.add(func, this);
|
idle_register.add<FilePanel>(func, this, false);
|
||||||
|
|
||||||
show_all ();
|
show_all ();
|
||||||
}
|
}
|
||||||
|
@ -412,18 +412,19 @@ void FlatField::setShortcutPath(const Glib::ustring& path)
|
|||||||
void FlatField::flatFieldAutoClipValueChanged(int n)
|
void FlatField::flatFieldAutoClipValueChanged(int n)
|
||||||
{
|
{
|
||||||
struct Data {
|
struct Data {
|
||||||
FlatField *me;
|
FlatField* self;
|
||||||
int n;
|
int n;
|
||||||
};
|
};
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
|
||||||
Data *d = static_cast<Data *>(data);
|
|
||||||
FlatField *me = d->me;
|
|
||||||
me->disableListener();
|
|
||||||
me->flatFieldClipControl->setValue (d->n);
|
|
||||||
me->enableListener();
|
|
||||||
delete d;
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, n });
|
const auto func =
|
||||||
}
|
[](Data* data) -> bool
|
||||||
|
{
|
||||||
|
FlatField* const self = data->self;
|
||||||
|
self->disableListener();
|
||||||
|
self->flatFieldClipControl->setValue (data->n);
|
||||||
|
self->enableListener();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
idle_register.add<Data>(func, new Data{this, n}, true);
|
||||||
|
}
|
||||||
|
@ -43,39 +43,14 @@ IdleRegister::~IdleRegister()
|
|||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdleRegister::add(GSourceFunc function, gpointer data, gint priority)
|
|
||||||
{
|
|
||||||
const auto dispatch = [](gpointer data) -> gboolean {
|
|
||||||
DataWrapper* const data_wrapper = static_cast<DataWrapper*>(data);
|
|
||||||
|
|
||||||
if (!data_wrapper->function(data_wrapper->data)) {
|
|
||||||
data_wrapper->self->mutex.lock();
|
|
||||||
data_wrapper->self->ids.erase(data_wrapper);
|
|
||||||
data_wrapper->self->mutex.unlock();
|
|
||||||
|
|
||||||
delete data_wrapper;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
DataWrapper* const data_wrapper = new DataWrapper{
|
|
||||||
this,
|
|
||||||
function,
|
|
||||||
data
|
|
||||||
};
|
|
||||||
|
|
||||||
mutex.lock();
|
|
||||||
ids[data_wrapper] = gdk_threads_add_idle_full(priority, dispatch, data_wrapper, nullptr);
|
|
||||||
mutex.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
void IdleRegister::destroy()
|
void IdleRegister::destroy()
|
||||||
{
|
{
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
for (const auto& id : ids) {
|
for (const auto& id : ids) {
|
||||||
g_source_remove(id.second);
|
g_source_remove(id.second);
|
||||||
|
if (id.first->deleter) {
|
||||||
|
id.first->deleter(id.first->data);
|
||||||
|
}
|
||||||
delete id.first;
|
delete id.first;
|
||||||
}
|
}
|
||||||
ids.clear();
|
ids.clear();
|
||||||
@ -1278,7 +1253,7 @@ MyFileChooserButton::MyFileChooserButton(const Glib::ustring &title, Gtk::FileCh
|
|||||||
if (GTK_MINOR_VERSION < 20) {
|
if (GTK_MINOR_VERSION < 20) {
|
||||||
set_border_width(2); // margin doesn't work on GTK < 3.20
|
set_border_width(2); // margin doesn't work on GTK < 3.20
|
||||||
}
|
}
|
||||||
|
|
||||||
set_name("MyFileChooserButton");
|
set_name("MyFileChooserButton");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1368,7 +1343,7 @@ std::vector<Glib::RefPtr<Gtk::FileFilter>> MyFileChooserButton::list_filters()
|
|||||||
return file_filters_;
|
return file_filters_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MyFileChooserButton::set_current_folder(const std::string &filename)
|
bool MyFileChooserButton::set_current_folder(const std::string &filename)
|
||||||
{
|
{
|
||||||
current_folder_ = filename;
|
current_folder_ = filename;
|
||||||
|
@ -50,7 +50,54 @@ class IdleRegister final :
|
|||||||
public:
|
public:
|
||||||
~IdleRegister();
|
~IdleRegister();
|
||||||
|
|
||||||
void add(GSourceFunc function, gpointer data, gint priority = G_PRIORITY_DEFAULT_IDLE);
|
template<typename DATA>
|
||||||
|
void add(bool (*function)(DATA*), DATA* data, bool delete_data, gint priority = G_PRIORITY_DEFAULT_IDLE)
|
||||||
|
{
|
||||||
|
const auto dispatch =
|
||||||
|
[](gpointer data) -> gboolean
|
||||||
|
{
|
||||||
|
DataWrapper* const data_wrapper = static_cast<DataWrapper*>(data);
|
||||||
|
|
||||||
|
// This is safe as per https://en.cppreference.com/w/cpp/language/reinterpret_cast item 7)
|
||||||
|
if (!reinterpret_cast<bool (*)(DATA*)>(data_wrapper->function)(static_cast<DATA*>(data_wrapper->data))) {
|
||||||
|
data_wrapper->self->mutex.lock();
|
||||||
|
data_wrapper->self->ids.erase(data_wrapper);
|
||||||
|
data_wrapper->self->mutex.unlock();
|
||||||
|
|
||||||
|
if (data_wrapper->deleter) {
|
||||||
|
data_wrapper->deleter(data_wrapper->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
delete data_wrapper;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
};
|
||||||
|
|
||||||
|
DataWrapper* const data_wrapper = new DataWrapper{
|
||||||
|
this,
|
||||||
|
reinterpret_cast<GSourceFunc>(function),
|
||||||
|
data,
|
||||||
|
[delete_data]() -> GSourceFunc
|
||||||
|
{
|
||||||
|
if (delete_data) {
|
||||||
|
return
|
||||||
|
[](gpointer data) -> gboolean
|
||||||
|
{
|
||||||
|
delete static_cast<DATA*>(data);
|
||||||
|
return TRUE;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}()
|
||||||
|
};
|
||||||
|
|
||||||
|
mutex.lock();
|
||||||
|
ids[data_wrapper] = gdk_threads_add_idle_full(priority, dispatch, data_wrapper, nullptr);
|
||||||
|
mutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -58,6 +105,7 @@ private:
|
|||||||
IdleRegister* const self;
|
IdleRegister* const self;
|
||||||
GSourceFunc function;
|
GSourceFunc function;
|
||||||
gpointer data;
|
gpointer data;
|
||||||
|
GSourceFunc deleter;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::map<const DataWrapper*, guint> ids;
|
std::map<const DataWrapper*, guint> ids;
|
||||||
@ -399,7 +447,7 @@ public:
|
|||||||
|
|
||||||
sigc::signal<void> &signal_selection_changed();
|
sigc::signal<void> &signal_selection_changed();
|
||||||
sigc::signal<void> &signal_file_set();
|
sigc::signal<void> &signal_file_set();
|
||||||
|
|
||||||
std::string get_filename() const;
|
std::string get_filename() const;
|
||||||
bool set_filename(const std::string &filename);
|
bool set_filename(const std::string &filename);
|
||||||
|
|
||||||
@ -407,7 +455,7 @@ public:
|
|||||||
void remove_filter(const Glib::RefPtr<Gtk::FileFilter> &filter);
|
void remove_filter(const Glib::RefPtr<Gtk::FileFilter> &filter);
|
||||||
void set_filter(const Glib::RefPtr<Gtk::FileFilter> &filter);
|
void set_filter(const Glib::RefPtr<Gtk::FileFilter> &filter);
|
||||||
std::vector<Glib::RefPtr<Gtk::FileFilter>> list_filters();
|
std::vector<Glib::RefPtr<Gtk::FileFilter>> list_filters();
|
||||||
|
|
||||||
bool set_current_folder(const std::string &filename);
|
bool set_current_folder(const std::string &filename);
|
||||||
std::string get_current_folder() const;
|
std::string get_current_folder() const;
|
||||||
|
|
||||||
|
@ -44,11 +44,11 @@ HistogramPanel::HistogramPanel ()
|
|||||||
|
|
||||||
histogramArea = Gtk::manage (new HistogramArea (this));
|
histogramArea = Gtk::manage (new HistogramArea (this));
|
||||||
setExpandAlignProperties(histogramArea, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
setExpandAlignProperties(histogramArea, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
||||||
|
|
||||||
histogramRGBArea = Gtk::manage (new HistogramRGBArea ());
|
histogramRGBArea = Gtk::manage (new HistogramRGBArea ());
|
||||||
setExpandAlignProperties(histogramRGBArea, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_END);
|
setExpandAlignProperties(histogramRGBArea, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_END);
|
||||||
histogramRGBArea->show();
|
histogramRGBArea->show();
|
||||||
|
|
||||||
// connecting the two childs
|
// connecting the two childs
|
||||||
histogramArea->signal_factor_changed().connect( sigc::mem_fun(*histogramRGBArea, &HistogramRGBArea::factorChanged) );
|
histogramArea->signal_factor_changed().connect( sigc::mem_fun(*histogramRGBArea, &HistogramRGBArea::factorChanged) );
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ HistogramPanel::HistogramPanel ()
|
|||||||
chroImage_g = new RTImage ("histogram-gold-off-small.png");
|
chroImage_g = new RTImage ("histogram-gold-off-small.png");
|
||||||
rawImage_g = new RTImage ("histogram-bayer-off-small.png");
|
rawImage_g = new RTImage ("histogram-bayer-off-small.png");
|
||||||
barImage_g = new RTImage ("histogram-bar-off-small.png");
|
barImage_g = new RTImage ("histogram-bar-off-small.png");
|
||||||
|
|
||||||
mode0Image = new RTImage ("histogram-mode-linear-small.png");
|
mode0Image = new RTImage ("histogram-mode-linear-small.png");
|
||||||
mode1Image = new RTImage ("histogram-mode-logx-small.png");
|
mode1Image = new RTImage ("histogram-mode-logx-small.png");
|
||||||
mode2Image = new RTImage ("histogram-mode-logxy-small.png");
|
mode2Image = new RTImage ("histogram-mode-logxy-small.png");
|
||||||
@ -226,9 +226,9 @@ void HistogramPanel::resized (Gtk::Allocation& req)
|
|||||||
histogramRGBArea->updateBackBuffer(-1, -1, -1);
|
histogramRGBArea->updateBackBuffer(-1, -1, -1);
|
||||||
histogramRGBArea->queue_draw ();
|
histogramRGBArea->queue_draw ();
|
||||||
|
|
||||||
// Store current height of the histogram
|
// Store current height of the histogram
|
||||||
options.histogramHeight = get_height();
|
options.histogramHeight = get_height();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistogramPanel::red_toggled ()
|
void HistogramPanel::red_toggled ()
|
||||||
@ -346,7 +346,7 @@ void HistogramPanel::reorder (Gtk::PositionType align)
|
|||||||
|
|
||||||
// DrawModeListener interface:
|
// DrawModeListener interface:
|
||||||
void HistogramPanel::toggleButtonMode ()
|
void HistogramPanel::toggleButtonMode ()
|
||||||
{
|
{
|
||||||
if (options.histogramDrawMode == 0)
|
if (options.histogramDrawMode == 0)
|
||||||
showMode->set_image(*mode0Image);
|
showMode->set_image(*mode0Image);
|
||||||
else if (options.histogramDrawMode == 1)
|
else if (options.histogramDrawMode == 1)
|
||||||
@ -562,28 +562,28 @@ void HistogramRGBArea::update (int valh, int rh, int gh, int bh)
|
|||||||
|
|
||||||
harih->pending++;
|
harih->pending++;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
HistogramRGBAreaIdleHelper* const harih = static_cast<HistogramRGBAreaIdleHelper*>(data);
|
[](HistogramRGBAreaIdleHelper* harih) -> bool
|
||||||
|
{
|
||||||
|
if (harih->destroyed) {
|
||||||
|
if (harih->pending == 1) {
|
||||||
|
delete harih;
|
||||||
|
} else {
|
||||||
|
harih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
if (harih->destroyed) {
|
return false;
|
||||||
if (harih->pending == 1) {
|
|
||||||
delete harih;
|
|
||||||
} else {
|
|
||||||
harih->pending--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
harih->harea->updateBackBuffer(-1, -1, -1);
|
||||||
}
|
harih->harea->queue_draw ();
|
||||||
|
|
||||||
harih->harea->updateBackBuffer(-1, -1, -1);
|
harih->pending--;
|
||||||
harih->harea->queue_draw ();
|
|
||||||
|
|
||||||
harih->pending--;
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<HistogramRGBAreaIdleHelper>(func, harih, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, harih);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, bool bar)
|
void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, bool bar)
|
||||||
@ -655,7 +655,7 @@ void HistogramRGBArea::factorChanged (double newFactor)
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
// HistogramArea
|
// HistogramArea
|
||||||
HistogramArea::HistogramArea (DrawModeListener *fml) :
|
HistogramArea::HistogramArea (DrawModeListener *fml) :
|
||||||
valid(false), drawMode(options.histogramDrawMode), myDrawModeListener(fml),
|
valid(false), drawMode(options.histogramDrawMode), myDrawModeListener(fml),
|
||||||
oldwidth(-1), oldheight(-1),
|
oldwidth(-1), oldheight(-1),
|
||||||
needRed(options.histogramRed), needGreen(options.histogramGreen), needBlue(options.histogramBlue),
|
needRed(options.histogramRed), needGreen(options.histogramGreen), needBlue(options.histogramBlue),
|
||||||
@ -703,14 +703,14 @@ void HistogramArea::get_preferred_height_vfunc (int &minimum_height, int &natura
|
|||||||
|
|
||||||
void HistogramArea::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
void HistogramArea::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||||
{
|
{
|
||||||
|
|
||||||
minimum_width = 200;
|
minimum_width = 200;
|
||||||
natural_width = 400;
|
natural_width = 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistogramArea::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
void HistogramArea::get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const
|
||||||
{
|
{
|
||||||
|
|
||||||
minimum_height = 0;
|
minimum_height = 0;
|
||||||
natural_height = 0;
|
natural_height = 0;
|
||||||
}
|
}
|
||||||
@ -722,7 +722,7 @@ void HistogramArea::get_preferred_width_for_height_vfunc (int height, int &minim
|
|||||||
|
|
||||||
void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode)
|
void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
options.histogramRed = needRed = r;
|
options.histogramRed = needRed = r;
|
||||||
options.histogramGreen = needGreen = g;
|
options.histogramGreen = needGreen = g;
|
||||||
options.histogramBlue = needBlue = b;
|
options.histogramBlue = needBlue = b;
|
||||||
@ -761,29 +761,29 @@ void HistogramArea::update(
|
|||||||
|
|
||||||
haih->pending++;
|
haih->pending++;
|
||||||
// Can be done outside of the GUI thread
|
// Can be done outside of the GUI thread
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
HistogramAreaIdleHelper* const haih = static_cast<HistogramAreaIdleHelper*>(data);
|
[](HistogramAreaIdleHelper* haih) -> bool
|
||||||
|
{
|
||||||
|
if (haih->destroyed) {
|
||||||
|
if (haih->pending == 1) {
|
||||||
|
delete haih;
|
||||||
|
} else {
|
||||||
|
haih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
if (haih->destroyed) {
|
return false;
|
||||||
if (haih->pending == 1) {
|
|
||||||
delete haih;
|
|
||||||
} else {
|
|
||||||
haih->pending--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
haih->harea->setDirty (true);
|
||||||
}
|
haih->harea->updateBackBuffer ();
|
||||||
|
haih->harea->queue_draw ();
|
||||||
|
|
||||||
haih->harea->setDirty (true);
|
haih->pending--;
|
||||||
haih->harea->updateBackBuffer ();
|
|
||||||
haih->harea->queue_draw ();
|
|
||||||
|
|
||||||
haih->pending--;
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<HistogramAreaIdleHelper>(func, haih, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, haih);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistogramArea::updateBackBuffer ()
|
void HistogramArea::updateBackBuffer ()
|
||||||
@ -889,7 +889,7 @@ void HistogramArea::updateBackBuffer ()
|
|||||||
|
|
||||||
// Compute the highest point of the histogram for scaling
|
// Compute the highest point of the histogram for scaling
|
||||||
// Values at far left and right end (0 and 255) are handled differently
|
// Values at far left and right end (0 and 255) are handled differently
|
||||||
|
|
||||||
unsigned int histheight = 0;
|
unsigned int histheight = 0;
|
||||||
|
|
||||||
for (int i = 1; i < 255; i++) {
|
for (int i = 1; i < 255; i++) {
|
||||||
@ -915,7 +915,7 @@ void HistogramArea::updateBackBuffer ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int realhistheight = histheight;
|
int realhistheight = histheight;
|
||||||
|
|
||||||
if (realhistheight < winh - 2) {
|
if (realhistheight < winh - 2) {
|
||||||
realhistheight = winh - 2;
|
realhistheight = winh - 2;
|
||||||
}
|
}
|
||||||
@ -960,7 +960,7 @@ void HistogramArea::updateBackBuffer ()
|
|||||||
cr->stroke ();
|
cr->stroke ();
|
||||||
drawMarks(cr, bhchanged, realhistheight, w, ui, oi);
|
drawMarks(cr, bhchanged, realhistheight, w, ui, oi);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the frame's border
|
// Draw the frame's border
|
||||||
@ -1044,16 +1044,16 @@ bool HistogramArea::on_button_press_event (GdkEventButton* event)
|
|||||||
{
|
{
|
||||||
isPressed = true;
|
isPressed = true;
|
||||||
movingPosition = event->x;
|
movingPosition = event->x;
|
||||||
|
|
||||||
if (event->type == GDK_2BUTTON_PRESS && event->button == 1) {
|
if (event->type == GDK_2BUTTON_PRESS && event->button == 1) {
|
||||||
|
|
||||||
drawMode = (drawMode + 1) % 3;
|
drawMode = (drawMode + 1) % 3;
|
||||||
options.histogramDrawMode = (options.histogramDrawMode + 1) % 3;
|
options.histogramDrawMode = (options.histogramDrawMode + 1) % 3;
|
||||||
|
|
||||||
if (myDrawModeListener) {
|
if (myDrawModeListener) {
|
||||||
myDrawModeListener->toggleButtonMode ();
|
myDrawModeListener->toggleButtonMode ();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateBackBuffer ();
|
updateBackBuffer ();
|
||||||
queue_draw ();
|
queue_draw ();
|
||||||
}
|
}
|
||||||
@ -1072,19 +1072,19 @@ bool HistogramArea::on_motion_notify_event (GdkEventMotion* event)
|
|||||||
if (isPressed)
|
if (isPressed)
|
||||||
{
|
{
|
||||||
double mod = 1 + (event->x - movingPosition) / get_width();
|
double mod = 1 + (event->x - movingPosition) / get_width();
|
||||||
|
|
||||||
factor /= mod;
|
factor /= mod;
|
||||||
if (factor < 1.0)
|
if (factor < 1.0)
|
||||||
factor = 1.0;
|
factor = 1.0;
|
||||||
if (factor > 100.0)
|
if (factor > 100.0)
|
||||||
factor = 100.0;
|
factor = 100.0;
|
||||||
|
|
||||||
sigFactorChanged.emit(factor);
|
sigFactorChanged.emit(factor);
|
||||||
|
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
queue_draw ();
|
queue_draw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1516,28 +1516,28 @@ void MyDiagonalCurve::updateBackgroundHistogram (LUTu & hist)
|
|||||||
|
|
||||||
mcih->pending++;
|
mcih->pending++;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
MyCurveIdleHelper* const mcih = static_cast<MyCurveIdleHelper*>(data);
|
[](MyCurveIdleHelper* mcih) -> bool
|
||||||
|
{
|
||||||
|
if (mcih->destroyed) {
|
||||||
|
if (mcih->pending == 1) {
|
||||||
|
delete mcih;
|
||||||
|
} else {
|
||||||
|
mcih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
if (mcih->destroyed) {
|
return false;
|
||||||
if (mcih->pending == 1) {
|
|
||||||
delete mcih;
|
|
||||||
} else {
|
|
||||||
mcih->pending--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
mcih->clearPixmap ();
|
||||||
}
|
mcih->myCurve->queue_draw ();
|
||||||
|
|
||||||
mcih->clearPixmap ();
|
mcih->pending--;
|
||||||
mcih->myCurve->queue_draw ();
|
|
||||||
|
|
||||||
mcih->pending--;
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<MyCurveIdleHelper>(func, mcih, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, mcih);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyDiagonalCurve::reset(const std::vector<double> &resetCurve, double identityValue)
|
void MyDiagonalCurve::reset(const std::vector<double> &resetCurve, double identityValue)
|
||||||
|
@ -67,40 +67,38 @@ void PreviewHandler::setImage(rtengine::IImage8* i, double scale, const rtengine
|
|||||||
iap->scale = scale;
|
iap->scale = scale;
|
||||||
iap->cp = cp;
|
iap->cp = cp;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
iaimgpar* const iap = static_cast<iaimgpar*>(data);
|
[](iaimgpar* iap) -> bool
|
||||||
PreviewHandlerIdleHelper* const pih = iap->pih;
|
{
|
||||||
|
PreviewHandlerIdleHelper* const pih = iap->pih;
|
||||||
|
|
||||||
if (pih->destroyed) {
|
if (pih->destroyed) {
|
||||||
if (pih->pending == 1) {
|
if (pih->pending == 1) {
|
||||||
delete pih;
|
delete pih;
|
||||||
} else {
|
} else {
|
||||||
pih->pending--;
|
pih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete iap;
|
if (pih->phandler->image) {
|
||||||
|
IImage8* const oldImg = pih->phandler->image;
|
||||||
|
oldImg->getMutex().lock ();
|
||||||
|
pih->phandler->image = iap->image;
|
||||||
|
oldImg->getMutex().unlock ();
|
||||||
|
} else {
|
||||||
|
pih->phandler->image = iap->image;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
pih->phandler->cropParams = iap->cp;
|
||||||
}
|
pih->phandler->previewScale = iap->scale;
|
||||||
|
pih->pending--;
|
||||||
|
|
||||||
if (pih->phandler->image) {
|
return false;
|
||||||
IImage8* const oldImg = pih->phandler->image;
|
};
|
||||||
oldImg->getMutex().lock ();
|
|
||||||
pih->phandler->image = iap->image;
|
|
||||||
oldImg->getMutex().unlock ();
|
|
||||||
} else {
|
|
||||||
pih->phandler->image = iap->image;
|
|
||||||
}
|
|
||||||
|
|
||||||
pih->phandler->cropParams = iap->cp;
|
idle_register.add<iaimgpar>(func, iap, true);
|
||||||
pih->phandler->previewScale = iap->scale;
|
|
||||||
pih->pending--;
|
|
||||||
delete iap;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, iap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -112,41 +110,39 @@ void PreviewHandler::delImage(IImage8* i)
|
|||||||
iap->image = i;
|
iap->image = i;
|
||||||
iap->pih = pih;
|
iap->pih = pih;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
iaimgpar* iap = static_cast<iaimgpar*>(data);
|
[](iaimgpar* iap) -> bool
|
||||||
PreviewHandlerIdleHelper* pih = iap->pih;
|
{
|
||||||
|
PreviewHandlerIdleHelper* const pih = iap->pih;
|
||||||
|
|
||||||
if (pih->destroyed) {
|
if (pih->destroyed) {
|
||||||
if (pih->pending == 1) {
|
if (pih->pending == 1) {
|
||||||
delete pih;
|
delete pih;
|
||||||
} else {
|
} else {
|
||||||
pih->pending--;
|
pih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete iap;
|
if (pih->phandler->image) {
|
||||||
|
IImage8* oldImg = pih->phandler->image;
|
||||||
|
oldImg->getMutex().lock ();
|
||||||
|
pih->phandler->image = nullptr;
|
||||||
|
oldImg->getMutex().unlock ();
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
iap->image->free ();
|
||||||
}
|
pih->phandler->previewImgMutex.lock ();
|
||||||
|
pih->phandler->previewImg.clear ();
|
||||||
|
pih->phandler->previewImgMutex.unlock ();
|
||||||
|
|
||||||
if (pih->phandler->image) {
|
pih->pending--;
|
||||||
IImage8* oldImg = pih->phandler->image;
|
|
||||||
oldImg->getMutex().lock ();
|
|
||||||
pih->phandler->image = nullptr;
|
|
||||||
oldImg->getMutex().unlock ();
|
|
||||||
}
|
|
||||||
|
|
||||||
iap->image->free ();
|
return false;
|
||||||
pih->phandler->previewImgMutex.lock ();
|
};
|
||||||
pih->phandler->previewImg.clear ();
|
|
||||||
pih->phandler->previewImgMutex.unlock ();
|
|
||||||
|
|
||||||
pih->pending--;
|
idle_register.add<iaimgpar>(func, iap, true);
|
||||||
delete iap;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, iap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreviewHandler::imageReady(const rtengine::procparams::CropParams& cp)
|
void PreviewHandler::imageReady(const rtengine::procparams::CropParams& cp)
|
||||||
@ -156,34 +152,32 @@ void PreviewHandler::imageReady(const rtengine::procparams::CropParams& cp)
|
|||||||
iap->pih = pih;
|
iap->pih = pih;
|
||||||
iap->cp = cp;
|
iap->cp = cp;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
iaimgpar* const iap = static_cast<iaimgpar*>(data);
|
[](iaimgpar* iap) -> bool
|
||||||
PreviewHandlerIdleHelper* pih = iap->pih;
|
{
|
||||||
|
PreviewHandlerIdleHelper* const pih = iap->pih;
|
||||||
|
|
||||||
if (pih->destroyed) {
|
if (pih->destroyed) {
|
||||||
if (pih->pending == 1) {
|
if (pih->pending == 1) {
|
||||||
delete pih;
|
delete pih;
|
||||||
} else {
|
} else {
|
||||||
pih->pending--;
|
pih->pending--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete iap;
|
pih->phandler->previewImgMutex.lock ();
|
||||||
|
pih->phandler->previewImg = Gdk::Pixbuf::create_from_data (pih->phandler->image->getData(), Gdk::COLORSPACE_RGB, false, 8, pih->phandler->image->getWidth(), pih->phandler->image->getHeight(), 3 * pih->phandler->image->getWidth());
|
||||||
|
pih->phandler->previewImgMutex.unlock ();
|
||||||
|
pih->phandler->cropParams = iap->cp;
|
||||||
|
pih->phandler->previewImageChanged ();
|
||||||
|
pih->pending--;
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
pih->phandler->previewImgMutex.lock ();
|
idle_register.add<iaimgpar>(func, iap, true);
|
||||||
pih->phandler->previewImg = Gdk::Pixbuf::create_from_data (pih->phandler->image->getData(), Gdk::COLORSPACE_RGB, false, 8, pih->phandler->image->getWidth(), pih->phandler->image->getHeight(), 3 * pih->phandler->image->getWidth());
|
|
||||||
pih->phandler->previewImgMutex.unlock ();
|
|
||||||
pih->phandler->cropParams = iap->cp;
|
|
||||||
pih->phandler->previewImageChanged ();
|
|
||||||
pih->pending--;
|
|
||||||
delete iap;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, iap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::RefPtr<Gdk::Pixbuf> PreviewHandler::getRoughImage (int x, int y, int w, int h, double zoom)
|
Glib::RefPtr<Gdk::Pixbuf> PreviewHandler::getRoughImage (int x, int y, int w, int h, double zoom)
|
||||||
|
126
rtgui/resize.cc
126
rtgui/resize.cc
@ -95,7 +95,7 @@ Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), fals
|
|||||||
allowUpscaling = Gtk::manage(new Gtk::CheckButton(M("TP_RESIZE_ALLOW_UPSCALING")));
|
allowUpscaling = Gtk::manage(new Gtk::CheckButton(M("TP_RESIZE_ALLOW_UPSCALING")));
|
||||||
sizeBox->pack_start(*allowUpscaling);
|
sizeBox->pack_start(*allowUpscaling);
|
||||||
allowUpscaling->signal_toggled().connect(sigc::mem_fun(*this, &Resize::allowUpscalingChanged));
|
allowUpscaling->signal_toggled().connect(sigc::mem_fun(*this, &Resize::allowUpscalingChanged));
|
||||||
|
|
||||||
sizeBox->show_all ();
|
sizeBox->show_all ();
|
||||||
sizeBox->reference ();
|
sizeBox->reference ();
|
||||||
|
|
||||||
@ -366,76 +366,76 @@ void Resize::sizeChanged(int mw, int mh, int ow, int oh)
|
|||||||
|
|
||||||
void Resize::setDimensions ()
|
void Resize::setDimensions ()
|
||||||
{
|
{
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Resize* const self = static_cast<Resize*>(data);
|
[](Resize* self) -> bool
|
||||||
|
{
|
||||||
|
self->wconn.block(true);
|
||||||
|
self->hconn.block(true);
|
||||||
|
self->scale->block(true);
|
||||||
|
|
||||||
self->wconn.block(true);
|
int refw, refh;
|
||||||
self->hconn.block(true);
|
|
||||||
self->scale->block(true);
|
|
||||||
|
|
||||||
int refw, refh;
|
if (self->appliesTo->get_active_row_number() == 0 && self->cropw) {
|
||||||
|
// Applies to Cropped area
|
||||||
if (self->appliesTo->get_active_row_number() == 0 && self->cropw) {
|
refw = self->cropw;
|
||||||
// Applies to Cropped area
|
refh = self->croph;
|
||||||
refw = self->cropw;
|
} else {
|
||||||
refh = self->croph;
|
// Applies to Full image or crop is disabled
|
||||||
} else {
|
refw = self->maxw;
|
||||||
// Applies to Full image or crop is disabled
|
refh = self->maxh;
|
||||||
refw = self->maxw;
|
|
||||||
refh = self->maxh;
|
|
||||||
}
|
|
||||||
|
|
||||||
self->w->set_range(32, MAX_SCALE * refw);
|
|
||||||
self->h->set_range(32, MAX_SCALE * refh);
|
|
||||||
|
|
||||||
switch (self->spec->get_active_row_number()) {
|
|
||||||
case 0: {
|
|
||||||
// Scale mode
|
|
||||||
self->w->set_value(static_cast<double>(static_cast<int>(static_cast<double>(refw) * self->scale->getValue() + 0.5)));
|
|
||||||
self->h->set_value(static_cast<double>(static_cast<int>(static_cast<double>(refh) * self->scale->getValue() + 0.5)));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case 1: {
|
self->w->set_range(32, MAX_SCALE * refw);
|
||||||
// Width mode
|
self->h->set_range(32, MAX_SCALE * refh);
|
||||||
const double tmp_scale = self->w->get_value() / static_cast<double>(refw);
|
|
||||||
self->scale->setValue(tmp_scale);
|
switch (self->spec->get_active_row_number()) {
|
||||||
self->h->set_value(static_cast<double>(static_cast<int>(static_cast<double>(refh) * tmp_scale + 0.5)));
|
case 0: {
|
||||||
break;
|
// Scale mode
|
||||||
|
self->w->set_value(static_cast<double>(static_cast<int>(static_cast<double>(refw) * self->scale->getValue() + 0.5)));
|
||||||
|
self->h->set_value(static_cast<double>(static_cast<int>(static_cast<double>(refh) * self->scale->getValue() + 0.5)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 1: {
|
||||||
|
// Width mode
|
||||||
|
const double tmp_scale = self->w->get_value() / static_cast<double>(refw);
|
||||||
|
self->scale->setValue(tmp_scale);
|
||||||
|
self->h->set_value(static_cast<double>(static_cast<int>(static_cast<double>(refh) * tmp_scale + 0.5)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 2: {
|
||||||
|
// Height mode
|
||||||
|
const double tmp_scale = self->h->get_value() / static_cast<double>(refh);
|
||||||
|
self->scale->setValue(tmp_scale);
|
||||||
|
self->w->set_value(static_cast<double>(static_cast<int>(static_cast<double>(refw) * tmp_scale + 0.5)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 3: {
|
||||||
|
// Bounding box mode
|
||||||
|
const double tmp_scale =
|
||||||
|
self->w->get_value() / self->h->get_value() < static_cast<double>(refw) / static_cast<double>(refh)
|
||||||
|
? self->w->get_value() / static_cast<double>(refw)
|
||||||
|
: self->h->get_value() / static_cast<double>(refh);
|
||||||
|
|
||||||
|
self->scale->setValue(tmp_scale);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case 2: {
|
self->scale->block(false);
|
||||||
// Height mode
|
self->wconn.block(false);
|
||||||
const double tmp_scale = self->h->get_value() / static_cast<double>(refh);
|
self->hconn.block(false);
|
||||||
self->scale->setValue(tmp_scale);
|
|
||||||
self->w->set_value(static_cast<double>(static_cast<int>(static_cast<double>(refw) * tmp_scale + 0.5)));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 3: {
|
return false;
|
||||||
// Bounding box mode
|
};
|
||||||
const double tmp_scale =
|
|
||||||
self->w->get_value() / self->h->get_value() < static_cast<double>(refw) / static_cast<double>(refh)
|
|
||||||
? self->w->get_value() / static_cast<double>(refw)
|
|
||||||
: self->h->get_value() / static_cast<double>(refh);
|
|
||||||
|
|
||||||
self->scale->setValue(tmp_scale);
|
idle_register.add<Resize>(func, this, false);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self->scale->block(false);
|
|
||||||
self->wconn.block(false);
|
|
||||||
self->hconn.block(false);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Resize::fitBoxScale()
|
void Resize::fitBoxScale()
|
||||||
|
@ -673,14 +673,16 @@ void Retinex::minmaxChanged (double cdma, double cdmin, double mini, double maxi
|
|||||||
nextminT = Tmin;
|
nextminT = Tmin;
|
||||||
nextmaxT = Tmax;
|
nextmaxT = Tmax;
|
||||||
|
|
||||||
const auto func = [] (gpointer data) -> gboolean {
|
const auto func =
|
||||||
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
|
[](Retinex* self) -> bool
|
||||||
static_cast<Retinex*> (data)->minmaxComputed_();
|
{
|
||||||
|
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
|
||||||
|
// FIXME: The above can't be true?!
|
||||||
|
self->minmaxComputed_();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<Retinex>(func, this, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add (func, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Retinex::minmaxComputed_ ()
|
bool Retinex::minmaxComputed_ ()
|
||||||
|
@ -45,7 +45,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA
|
|||||||
pack_start(*clampOOG);
|
pack_start(*clampOOG);
|
||||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||||
clampOOG->signal_toggled().connect(sigc::mem_fun(*this, &ToneCurve::clampOOGChanged));
|
clampOOG->signal_toggled().connect(sigc::mem_fun(*this, &ToneCurve::clampOOGChanged));
|
||||||
|
|
||||||
//----------- Auto Levels ----------------------------------
|
//----------- Auto Levels ----------------------------------
|
||||||
abox = Gtk::manage (new Gtk::HBox ());
|
abox = Gtk::manage (new Gtk::HBox ());
|
||||||
abox->set_spacing (10);
|
abox->set_spacing (10);
|
||||||
@ -238,7 +238,7 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
|
|||||||
if (!black->getAddMode() && !batchMode) {
|
if (!black->getAddMode() && !batchMode) {
|
||||||
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
|
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hlcompr->getAddMode() && !batchMode) {
|
if (!hlcompr->getAddMode() && !batchMode) {
|
||||||
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
||||||
}
|
}
|
||||||
@ -604,7 +604,7 @@ void ToneCurve::adjusterChanged(Adjuster* a, double newval)
|
|||||||
if (a != expcomp && a != hlcompr && a != hlcomprthresh) {
|
if (a != expcomp && a != hlcompr && a != hlcomprthresh) {
|
||||||
setHistmatching(false);
|
setHistmatching(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::ustring costr;
|
Glib::ustring costr;
|
||||||
|
|
||||||
if (a == expcomp) {
|
if (a == expcomp) {
|
||||||
@ -629,7 +629,7 @@ void ToneCurve::adjusterChanged(Adjuster* a, double newval)
|
|||||||
listener->panelChanged (EvSaturation, costr);
|
listener->panelChanged (EvSaturation, costr);
|
||||||
} else if (a == hlcompr) {
|
} else if (a == hlcompr) {
|
||||||
listener->panelChanged (EvHLCompr, costr);
|
listener->panelChanged (EvHLCompr, costr);
|
||||||
|
|
||||||
if (!hlcompr->getAddMode() && !batchMode) {
|
if (!hlcompr->getAddMode() && !batchMode) {
|
||||||
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
||||||
}
|
}
|
||||||
@ -650,7 +650,7 @@ void ToneCurve::neutral_pressed ()
|
|||||||
// and sets neutral values to params in exposure panel
|
// and sets neutral values to params in exposure panel
|
||||||
|
|
||||||
setHistmatching(false);
|
setHistmatching(false);
|
||||||
|
|
||||||
if (batchMode) {
|
if (batchMode) {
|
||||||
autolevels->set_inconsistent (false);
|
autolevels->set_inconsistent (false);
|
||||||
autoconn.block (true);
|
autoconn.block (true);
|
||||||
@ -680,7 +680,7 @@ void ToneCurve::neutral_pressed ()
|
|||||||
if (!black->getAddMode() && !batchMode) {
|
if (!black->getAddMode() && !batchMode) {
|
||||||
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
|
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hlcompr->getAddMode() && !batchMode) {
|
if (!hlcompr->getAddMode() && !batchMode) {
|
||||||
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
||||||
}
|
}
|
||||||
@ -754,7 +754,7 @@ void ToneCurve::autolevels_toggled ()
|
|||||||
if (!black->getAddMode()) {
|
if (!black->getAddMode()) {
|
||||||
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
|
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hlcompr->getAddMode() && !batchMode) {
|
if (!hlcompr->getAddMode() && !batchMode) {
|
||||||
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
||||||
}
|
}
|
||||||
@ -857,7 +857,7 @@ bool ToneCurve::autoExpComputed_ ()
|
|||||||
if (!black->getAddMode() && !batchMode) {
|
if (!black->getAddMode() && !batchMode) {
|
||||||
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
|
shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hlcompr->getAddMode() && !batchMode) {
|
if (!hlcompr->getAddMode() && !batchMode) {
|
||||||
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
||||||
}
|
}
|
||||||
@ -979,7 +979,7 @@ bool ToneCurve::histmatchingComputed()
|
|||||||
if (!black->getAddMode() && !batchMode) {
|
if (!black->getAddMode() && !batchMode) {
|
||||||
shcompr->set_sensitive(!((int)black->getValue() == 0));
|
shcompr->set_sensitive(!((int)black->getValue() == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hlcompr->getAddMode() && !batchMode) {
|
if (!hlcompr->getAddMode() && !batchMode) {
|
||||||
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect
|
||||||
}
|
}
|
||||||
@ -1013,13 +1013,14 @@ void ToneCurve::autoExpChanged(double expcomp, int bright, int contr, int black,
|
|||||||
nextHlcomprthresh = hlcomprthresh;
|
nextHlcomprthresh = hlcomprthresh;
|
||||||
nextHLRecons = hlrecons;
|
nextHLRecons = hlrecons;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<ToneCurve*>(data)->autoExpComputed_();
|
[](ToneCurve* self) -> bool
|
||||||
|
{
|
||||||
|
self->autoExpComputed_();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<ToneCurve>(func, this, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneCurve::autoMatchedToneCurveChanged(rtengine::procparams::ToneCurveParams::TcMode curveMode, const std::vector<double>& curve)
|
void ToneCurve::autoMatchedToneCurveChanged(rtengine::procparams::ToneCurveParams::TcMode curveMode, const std::vector<double>& curve)
|
||||||
@ -1027,11 +1028,12 @@ void ToneCurve::autoMatchedToneCurveChanged(rtengine::procparams::ToneCurveParam
|
|||||||
nextToneCurveMode = curveMode;
|
nextToneCurveMode = curveMode;
|
||||||
nextToneCurve = curve;
|
nextToneCurve = curve;
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
static_cast<ToneCurve*>(data)->histmatchingComputed();
|
[](ToneCurve* self) -> bool
|
||||||
|
{
|
||||||
|
self->histmatchingComputed();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
return FALSE;
|
idle_register.add<ToneCurve>(func, this, false);
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
|
@ -263,74 +263,74 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt
|
|||||||
{
|
{
|
||||||
if (isRaw) {
|
if (isRaw) {
|
||||||
if (isBayer) {
|
if (isBayer) {
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
|
[](ToolPanelCoordinator* self) -> bool
|
||||||
|
{
|
||||||
|
self->rawPanelSW->set_sensitive (true);
|
||||||
|
self->sensorxtrans->FoldableToolPanel::hide();
|
||||||
|
self->sensorbayer->FoldableToolPanel::show();
|
||||||
|
self->preprocess->FoldableToolPanel::show();
|
||||||
|
self->flatfield->FoldableToolPanel::show();
|
||||||
|
self->retinex->FoldableToolPanel::setGrayedOut(false);
|
||||||
|
|
||||||
self->rawPanelSW->set_sensitive (true);
|
return false;
|
||||||
self->sensorxtrans->FoldableToolPanel::hide();
|
};
|
||||||
self->sensorbayer->FoldableToolPanel::show();
|
idle_register.add<ToolPanelCoordinator>(func, this, false);
|
||||||
self->preprocess->FoldableToolPanel::show();
|
|
||||||
self->flatfield->FoldableToolPanel::show();
|
|
||||||
self->retinex->FoldableToolPanel::setGrayedOut(false);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
else if (isXtrans) {
|
else if (isXtrans) {
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
|
[](ToolPanelCoordinator* self) -> bool
|
||||||
|
{
|
||||||
|
self->rawPanelSW->set_sensitive (true);
|
||||||
|
self->sensorxtrans->FoldableToolPanel::show();
|
||||||
|
self->sensorbayer->FoldableToolPanel::hide();
|
||||||
|
self->preprocess->FoldableToolPanel::show();
|
||||||
|
self->flatfield->FoldableToolPanel::show();
|
||||||
|
self->retinex->FoldableToolPanel::setGrayedOut(false);
|
||||||
|
|
||||||
self->rawPanelSW->set_sensitive (true);
|
return false;
|
||||||
self->sensorxtrans->FoldableToolPanel::show();
|
};
|
||||||
self->sensorbayer->FoldableToolPanel::hide();
|
idle_register.add<ToolPanelCoordinator>(func, this, false);
|
||||||
self->preprocess->FoldableToolPanel::show();
|
|
||||||
self->flatfield->FoldableToolPanel::show();
|
|
||||||
self->retinex->FoldableToolPanel::setGrayedOut(false);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
else if (isMono) {
|
else if (isMono) {
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
|
[](ToolPanelCoordinator* self) -> bool
|
||||||
|
{
|
||||||
|
self->rawPanelSW->set_sensitive (true);
|
||||||
|
self->sensorbayer->FoldableToolPanel::hide();
|
||||||
|
self->sensorxtrans->FoldableToolPanel::hide();
|
||||||
|
self->preprocess->FoldableToolPanel::hide();
|
||||||
|
self->flatfield->FoldableToolPanel::show();
|
||||||
|
self->retinex->FoldableToolPanel::setGrayedOut(false);
|
||||||
|
|
||||||
self->rawPanelSW->set_sensitive (true);
|
return false;
|
||||||
self->sensorbayer->FoldableToolPanel::hide();
|
};
|
||||||
self->sensorxtrans->FoldableToolPanel::hide();
|
idle_register.add<ToolPanelCoordinator>(func, this, false);
|
||||||
self->preprocess->FoldableToolPanel::hide();
|
|
||||||
self->flatfield->FoldableToolPanel::show();
|
|
||||||
self->retinex->FoldableToolPanel::setGrayedOut(false);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
idle_register.add(func, this);
|
|
||||||
} else {
|
} else {
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
|
[](ToolPanelCoordinator* self) -> bool
|
||||||
|
{
|
||||||
|
self->rawPanelSW->set_sensitive (true);
|
||||||
|
self->sensorbayer->FoldableToolPanel::hide();
|
||||||
|
self->sensorxtrans->FoldableToolPanel::hide();
|
||||||
|
self->preprocess->FoldableToolPanel::hide();
|
||||||
|
self->flatfield->FoldableToolPanel::hide();
|
||||||
|
self->retinex->FoldableToolPanel::setGrayedOut(false);
|
||||||
|
|
||||||
self->rawPanelSW->set_sensitive (true);
|
return false;
|
||||||
self->sensorbayer->FoldableToolPanel::hide();
|
};
|
||||||
self->sensorxtrans->FoldableToolPanel::hide();
|
idle_register.add<ToolPanelCoordinator>(func, this, false);
|
||||||
self->preprocess->FoldableToolPanel::hide();
|
|
||||||
self->flatfield->FoldableToolPanel::hide();
|
|
||||||
self->retinex->FoldableToolPanel::setGrayedOut(false);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
|
[](ToolPanelCoordinator* self) -> bool
|
||||||
|
{
|
||||||
|
self->rawPanelSW->set_sensitive (false);
|
||||||
|
self->retinex->FoldableToolPanel::setGrayedOut(true);
|
||||||
|
|
||||||
self->rawPanelSW->set_sensitive (false);
|
return false;
|
||||||
self->retinex->FoldableToolPanel::setGrayedOut(true);
|
};
|
||||||
|
idle_register.add<ToolPanelCoordinator>(func, this, false);
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
idle_register.add(func, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -888,22 +888,22 @@ void Wavelet::wavChanged (double nlevel)
|
|||||||
{
|
{
|
||||||
if (!batchMode) {
|
if (!batchMode) {
|
||||||
struct Data {
|
struct Data {
|
||||||
Wavelet *me;
|
Wavelet *self;
|
||||||
double nlevel;
|
double nlevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
Data *d = static_cast<Data *>(data);
|
[](Data* data) -> bool
|
||||||
Wavelet *me = d->me;
|
{
|
||||||
me->wavLabels->set_text(
|
Wavelet* self = data->self;
|
||||||
Glib::ustring::compose(M("TP_WAVELET_LEVLABEL"),
|
self->wavLabels->set_text(
|
||||||
Glib::ustring::format(std::fixed, std::setprecision(0), d->nlevel))
|
Glib::ustring::compose(M("TP_WAVELET_LEVLABEL"),
|
||||||
);
|
Glib::ustring::format(std::fixed, std::setprecision(0), data->nlevel))
|
||||||
delete d;
|
);
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, nlevel });
|
idle_register.add<Data>(func, new Data{this, nlevel}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,7 +695,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
|
|||||||
}
|
}
|
||||||
|
|
||||||
green->setLogScale(10, green->getValue(), true);
|
green->setLogScale(10, green->getValue(), true);
|
||||||
|
|
||||||
methconn.block (false);
|
methconn.block (false);
|
||||||
enableListener ();
|
enableListener ();
|
||||||
}
|
}
|
||||||
@ -915,22 +915,23 @@ void WhiteBalance::WBChanged(double temperature, double greenVal)
|
|||||||
double green_val;
|
double green_val;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func =
|
||||||
WhiteBalance* const self = static_cast<WhiteBalance*>(static_cast<Data*>(data)->self);
|
[](Data* data) -> bool
|
||||||
const double temperature = static_cast<Data*>(data)->temperature;
|
{
|
||||||
const double green_val = static_cast<Data*>(data)->green_val;
|
WhiteBalance* const self = static_cast<WhiteBalance*>(data->self);
|
||||||
delete static_cast<Data*>(data);
|
const double temperature = data->temperature;
|
||||||
|
const double green_val = data->green_val;
|
||||||
|
|
||||||
self->disableListener();
|
self->disableListener();
|
||||||
self->setEnabled(true);
|
self->setEnabled(true);
|
||||||
self->temp->setValue(temperature);
|
self->temp->setValue(temperature);
|
||||||
self->green->setValue(green_val);
|
self->green->setValue(green_val);
|
||||||
self->temp->setDefault(temperature);
|
self->temp->setDefault(temperature);
|
||||||
self->green->setDefault(green_val);
|
self->green->setDefault(green_val);
|
||||||
self->enableListener();
|
self->enableListener();
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, new Data{this, temperature, greenVal});
|
idle_register.add<Data>(func, new Data{this, temperature, greenVal}, true);
|
||||||
}
|
}
|
||||||
|
@ -255,18 +255,19 @@ void XTransProcess::checkBoxToggled (CheckBox* c, CheckValue newval)
|
|||||||
void XTransProcess::autoContrastChanged (double autoContrast)
|
void XTransProcess::autoContrastChanged (double autoContrast)
|
||||||
{
|
{
|
||||||
struct Data {
|
struct Data {
|
||||||
XTransProcess *me;
|
XTransProcess* self;
|
||||||
double autoContrast;
|
double autoContrast;
|
||||||
};
|
};
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
|
||||||
Data *d = static_cast<Data *>(data);
|
|
||||||
XTransProcess *me = d->me;
|
|
||||||
me->disableListener();
|
|
||||||
me->dualDemosaicContrast->setValue(d->autoContrast);
|
|
||||||
me->enableListener();
|
|
||||||
delete d;
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
idle_register.add(func, new Data { this, autoContrast });
|
const auto func =
|
||||||
|
[](Data* data) -> bool
|
||||||
|
{
|
||||||
|
XTransProcess* self = data->self;
|
||||||
|
self->disableListener();
|
||||||
|
self->dualDemosaicContrast->setValue(data->autoContrast);
|
||||||
|
self->enableListener();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
idle_register.add<Data>(func, new Data{this, autoContrast}, true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user