Will tickPlatform always be the last TickReason?

26 views
Skip to first unread message

New Pagodi

unread,
Sep 7, 2017, 11:07:23 PM9/7/17
to scintilla-interest
I'm attempting an implementation of the FineTicker methods for the wxWidgets platform.  In Editor.h, the tick reasons are currently defined as:

enum TickReason { tickCaret, tickScroll, tickWiden, tickDwell, tickPlatform };

Is it safe to assume that tickPlatform will always be the last member of the enum?  In other words, if additional reasons are added, will they be added between tickDwell and tickPlatform?

If not, is there a future proof way to iterate over the tick reasons?

Thank you.

Neil Hodgson

unread,
Sep 8, 2017, 1:53:32 AM9/8/17
to Scintilla mailing list
New Pagodi:
Up until now, there hasn’t been any plan for allocating more tick reasons. tickPlatform is currently only used on Cocoa where it is used for scrolling during drag. The other built-in platforms only allocate up to tickDwell and the platform-independent code only ever uses up to tickDwell. To minimize changes its most likely that future common allocations would be before tickDwell but any changes will be discussed here.

Each built-in platform layer allocates its own ‘timers’ array, so you should dimension that with either tiickDwell+1 or tickPlatform+1 as required for your platform. Then that array should be the key to any iterations with the loop going up to the number of elements either using a C for loop to ELEMENTS(timers) or a C++-11 range for loop. A new platform layer implementation could use std::array instead of a C array.

Neil


New Pagodi

unread,
Sep 8, 2017, 11:33:44 PM9/8/17
to scintilla-interest
Thanks.  That's exactly what I needed to know.

Reply all
Reply to author
Forward
0 new messages