added a more flexible way of managing ProcEvents
modifying the global ProcEvent enum and refreshmap array is not needed anymore. You can now register new events dynamically, using a ProcEventMapper instance. See rtgui/localcontrast.cc for an example. Hopefully this solves the problem of recurring merge conflicts when different devs add different proc events
This commit is contained in:
@@ -26,7 +26,7 @@ namespace rtengine
|
||||
|
||||
|
||||
// Aligned so the first entry starts on line 30
|
||||
enum ProcEvent {
|
||||
enum ProcEventCode {
|
||||
EvPhotoLoaded = 0,
|
||||
EvProfileLoaded = 1,
|
||||
EvProfileChanged = 2,
|
||||
@@ -520,15 +520,31 @@ enum ProcEvent {
|
||||
EvWBEnabled = 490,
|
||||
EvRGBEnabled = 491,
|
||||
EvLEnabled = 492,
|
||||
EvLocalContrastEnabled = 493,
|
||||
EvLocalContrastRadius = 494,
|
||||
EvLocalContrastAmount = 495,
|
||||
EvLocalContrastDarkness = 496,
|
||||
EvLocalContrastLightness = 497,
|
||||
|
||||
NUMOFEVENTS
|
||||
|
||||
};
|
||||
|
||||
|
||||
class ProcEvent {
|
||||
public:
|
||||
ProcEvent(): code_(0) {}
|
||||
ProcEvent(ProcEventCode code): code_(code) {}
|
||||
explicit ProcEvent(int code): code_(code) {}
|
||||
operator int() { return code_; }
|
||||
|
||||
private:
|
||||
int code_;
|
||||
};
|
||||
|
||||
|
||||
inline bool operator==(ProcEvent a, ProcEvent b) { return int(a) == int(b); }
|
||||
inline bool operator==(ProcEvent a, ProcEventCode b) { return int(a) == int(b); }
|
||||
inline bool operator==(ProcEventCode a, ProcEvent b) { return int(a) == int(b); }
|
||||
inline bool operator!=(ProcEvent a, ProcEvent b) { return int(a) != int(b); }
|
||||
inline bool operator!=(ProcEvent a, ProcEventCode b) { return int(a) != int(b); }
|
||||
inline bool operator!=(ProcEventCode a, ProcEvent b) { return int(a) != int(b); }
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user