Skip to content

Commit 367999e

Browse files
committed
Merged branch 'add_flip_buttons' from manongjohn w/ conflicts resolved
2 parents ba10613 + eff652f commit 367999e

24 files changed

+1087
-156
lines changed

toonz/sources/include/toonzqt/flipconsole.h

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -184,54 +184,55 @@ class DVAPI FlipConsole final : public QWidget {
184184

185185
public:
186186
enum EGadget {
187-
eBegin = 0,
188-
ePlay = 0x1,
189-
eLoop = 0x2,
190-
ePause = 0x4,
191-
ePrev = 0x8,
192-
eNext = 0x10,
193-
eFirst = 0x20,
194-
eLast = 0x40,
195-
eRed = 0x80,
196-
eGreen = 0x100,
197-
eBlue = 0x200,
198-
eGRed = 0x400,
199-
eGGreen = 0x800,
200-
eGBlue = 0x1000,
201-
eMatte = 0x2000,
202-
eFrames = 0x4000,
203-
eRate = 0x8000,
204-
eSound = 0x10000,
205-
eHisto = 0x20000,
206-
eBlackBg = 0x40000,
207-
eWhiteBg = 0x80000,
208-
eCheckBg = 0x100000,
209-
eSaveImg = 0x200000,
210-
eCompare = 0x400000,
211-
eCustomize = 0x800000,
212-
eSave = 0x1000000,
213-
eDefineSubCamera = 0x2000000,
214-
eFilledRaster = 0x4000000, // Used only in LineTest
215-
eDefineLoadBox = 0x8000000,
216-
eUseLoadBox = 0x10000000,
217-
eLocator = 0x20000000,
218-
eEnd = 0x40000000
187+
eBegin,
188+
ePlay,
189+
eLoop,
190+
ePause,
191+
ePrev,
192+
eNext,
193+
eFirst,
194+
eLast,
195+
eRed,
196+
eGreen,
197+
eBlue,
198+
eGRed,
199+
eGGreen,
200+
eGBlue,
201+
eMatte,
202+
eFrames,
203+
eRate,
204+
eSound,
205+
eHisto,
206+
eBlackBg,
207+
eWhiteBg,
208+
eCheckBg,
209+
eSaveImg,
210+
eCompare,
211+
eCustomize,
212+
eSave,
213+
eDefineSubCamera,
214+
eFilledRaster, // Used only in LineTest
215+
eDefineLoadBox,
216+
eUseLoadBox,
217+
eLocator,
218+
eZoomIn,
219+
eZoomOut,
220+
eFlipHorizontal,
221+
eFlipVertical,
222+
eResetView,
223+
eEnd
219224
};
220225

221-
static const UINT cFullConsole = eEnd - 1;
222-
static const UINT cFilterRgb = eRed | eGreen | eBlue;
223-
static const UINT cFilterGRgb = eGRed | eGGreen | eGBlue;
224-
static const UINT eFilterRgbm = cFilterRgb | eMatte;
225-
226226
static FlipConsole *m_currentConsole;
227227
static QList<FlipConsole *> m_visibleConsoles;
228228
static bool m_isLinkedPlaying;
229229
static bool m_areLinked;
230230

231231
// blanksEnabled==true->at begin of each loop a number of blank frames are
232232
// drawn (according to rpeferences settings)
233-
FlipConsole(QVBoxLayout *layout, UINT gadgetsMask, bool isLinkable,
234-
QWidget *customWidget, const QString &customizeId,
233+
FlipConsole(QVBoxLayout *layout, std::vector<int> gadgetsMask,
234+
bool isLinkable, QWidget *customWidget,
235+
const QString &customizeId,
235236
FlipConsoleOwner *consoleOwner, // call
236237
// consoleOwner->onDrawFrame()
237238
// intead of emitting drawFrame
@@ -294,6 +295,12 @@ class DVAPI FlipConsole final : public QWidget {
294295
void playNextFrame();
295296
void updateCurrentFPS(int val);
296297

298+
bool hasButton(std::vector<int> buttonMask, FlipConsole::EGadget buttonId) {
299+
if (buttonMask.size() == 0) return true;
300+
return std::find(buttonMask.begin(), buttonMask.end(), buttonId) ==
301+
buttonMask.end();
302+
}
303+
297304
signals:
298305

299306
void buttonPressed(FlipConsole::EGadget button);
@@ -309,7 +316,7 @@ class DVAPI FlipConsole final : public QWidget {
309316

310317
QAction *m_customSep, *m_rateSep, *m_histoSep, *m_bgSep, *m_vcrSep,
311318
*m_compareSep, *m_saveSep, *m_colorFilterSep, *m_soundSep, *m_subcamSep,
312-
*m_filledRasterSep;
319+
*m_filledRasterSep, *m_viewerSep;
313320

314321
QToolBar *m_playToolBar;
315322
QActionGroup *m_colorFilterGroup;
@@ -325,7 +332,7 @@ class DVAPI FlipConsole final : public QWidget {
325332
QFrame *createFpsSlider();
326333
QAction *m_doubleRedAction, *m_doubleGreenAction, *m_doubleBlueAction;
327334
DoubleButton *m_doubleRed, *m_doubleGreen, *m_doubleBlue;
328-
UINT m_gadgetsMask;
335+
std::vector<int> m_gadgetsMask;
329336
int m_from, m_to, m_step;
330337
int m_currentFrame, m_framesCount;
331338
ImagePainter::VisualSettings m_settings;
@@ -358,7 +365,7 @@ class DVAPI FlipConsole final : public QWidget {
358365
QActionGroup *group, DoubleButton *&w);
359366

360367
QFrame *createFrameSlider();
361-
void createPlayToolBar(bool withCustomWidget);
368+
void createPlayToolBar(QWidget *customWidget);
362369
DVGui::IntLineEdit *m_editCurrFrame;
363370
FlipSlider *m_currFrameSlider;
364371

Lines changed: 65 additions & 0 deletions
Loading
Lines changed: 72 additions & 0 deletions
Loading
Lines changed: 65 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)