gtk2/testsuite
Christian Hergert ccac404f28 widget: fix class private data usage to be _init() safe
Before this commit, adding GtkWidgetAction to class private data would
require copying the actions to each subclass as they were built or
modified. This was convenient in that it is a sort of "copy on write"
semantic.

However, due to the way that GTypeInstance works with base _init()
functions, the "g_class" pointer in GTypeInstance is updated as each
_init() function is called. That means you cannot access the subclasses
class private data, but only the parent class private data.

If instead we use a singly linked list of GtkWidgetAction, each subclass
has their own "head" yet all subclasses share the tail of the
GtkWidgetAction chain.

This creates one bit of complexity though. You need a stable way to know
which "bit" is the "enabled" bit of the action so we can track enabled
GAction state. That is easily solved by calculating the distance to the
end of the chain for a given action so that base classes sort ahead of
subclasses. Since the parent class always knows its parent's actions, the
position is stable.

A new dynamic bitarray helper also helps us avoid allocations in all the
current cases (up to 64 actions per widget) and dynamically switches to
malloc if that is to ever be exceeded.
2020-03-20 11:17:56 -07:00
..
a11y testsuite: Fix an a11y test 2020-03-20 12:09:21 -04:00
css testsuite: disable performance tests 2020-03-20 13:47:58 -04:00
gdk testsuite: Tell meson we use TAP 2020-03-20 11:55:26 -04:00
gsk testsuite: Tell meson we use TAP 2020-03-20 11:55:26 -04:00
gtk widget: fix class private data usage to be _init() safe 2020-03-20 11:17:56 -07:00
performance testsuite/performance: Add common_cflags to build 2020-03-06 18:22:01 +01:00
reftests testsuite: Tell meson we use TAP 2020-03-20 11:55:26 -04:00
tools testsuite: Specify the test protocol 2020-03-13 15:53:19 -04:00
meson.build Make the performance testcase more general 2020-01-22 00:59:04 -05:00