shell: allow pre-paint-callbacks without graphable

This updates how we track pre-paint-callbacks in the shell so we can
register callbacks that don't have an associated graphable.

Note: Maybe later it might be better to track these completely
separately since the depth sorting for these callbacks is redundant.
prop-inspector: allow dragging of read-only props

We now only disable the widget of read-only properties not the whole
inspector which allows us to drag a read-only property to be a
dependency for a binding expression.
Update marking of editor mode code

This renames _rig_in_device_mode to _rig_in_editor_mode since almost
every test of _rig_in_device_mode is negated assuming that if we aren't
in device mode then we must be in editor mode, which might not make
sense if we introduce other, non mutually exclusive mode/option states.
E.g what if we defined a "slave" mode for running rig-slave or if we
introduce a "simulator"/"headless" mode for updating properties without
graphics then we also wouldn't be in device mode but that wouldn't imply
we are running the editor either.
pb-rpc: peer to peer support

This adds support for peer to peer, protocol buffer based rpc
connections where each end may act as a client and a server while
sharing a single file descriptor.

Since the status field for client replies was actually being ignored
this removes the field so the headers for server requests and client
replies are the same. Replies can be distinguished from requests because
the method_index will == ~0 for replies.

A new PB_RPC_Peer object has been introduced that internally wraps a
PB_RPC_Client and a PB_RPC_Server which both share a newly defined
Stream object that handles buffered IO.

For now the code only supports peer to peer connections where each peer
already has an open file descriptor since our use case is that we will
be fork()ing a child process after using socketpair() to open two file
descriptors for a stream socket to be used for the peer to peer rpc
connection.
Run a headless simulator process

This lays the groundwork for moving UI logic into a separate process
from the rendering process.

When initializing the Rig engine in rig_engine_init we now fork and exec
a rig-simulator binary which we can communicate with via a peer to peer
rpc connection over a socket stream.

The intention is that the main renderer process will feed the simulator
process with any necessary input events for each frame, the simulator
will asynchronously update the graph of entities, by running all UI
logic and updating properties and for each frame it will send back the
changes to the renderer process.

This design will help us to avoid blocking the renderer process to keep
animations smooth and will also enable us to remote debug code in the
simulator so we can set breakpoints in the editor and step through code.
defer redraw control to rig programs

Instead of having a single _rut_shell_paint that controls the redraw
cycle each frame, we now expose several shell functions that can be used
to implement redraw functions in each of the rig binaries. This lets
us have a redraw function in the simulator process that doesn't call
rig_engine_paint() and will be able to send its property updates to the
renderer process at the end of each frame.
shell: queue input events until next redraw

This synchronizes input processing with the redraw cycle. This way we
will be able to send input across to the simulator process in per-frame
batches and it will also help us avoid picking for out-of-date pointer
move events.
device: Forward input events to the simulator

Whenever we start a new frame in rig-device we request the simulator to
run a frame too. As input to each simulator frame we now forward all
input events that are currently queued up.

This introduces a new RutStreamEvent that can be considered to be the
native event for the simulator process. The native events received via
SDL in the renderer process are serialized to be sent to the simulator
process to become RutStreamEvents.
peer: associate user_data with server connection

This makes sure we associate the user_data given to rig_rpc_peer_new()
with the server-connection so that when a request is made to the server
we can get the user data via rig_pb_rpc_closure_get_connection_data().

This fixes a crash in the simulator when being requested to run a new
frame.
clarify frontend vs simulator split

This adds RigFrontend and RigSimulator types that we can use to start
splitting state out from RigEngine if it is not applicable to both.
What was called the "renderer service" has now been renamed to the
"frontend service" since it's currently responsible for more than just
renderering.
shell: headless: track pointer x/y for button events
simulator: exit on error

We now make the simulator process exit if we stop the simulator service
since we have no way to recover from this currently and the process is
no longer useful if not connected to a frontend.
shape: Add width/height properties

This adds introspectable width and height properties to RutShape and
updates the [un]serializing code to box all introspected properties
automatically.
mesh: Add rut_attribute_set_normalized() api

This adds api for setting whether a mesh attribute is for normalized
values or not.
Support serializing and loading the UI in the simulator

This bootstraps being able to initialize the state of the simulator
process by being able to send it a description of the UI similar to
how we send the UI to a slave process.

Notably this adds support for serializing and unserializing RutMesh
objects and their associated attributes and buffers, instead of relying
on simply sending ply files over the wire; something we've needed for
some time really.

This exposes RigPBSerializer and RigPBUnSerializer objects for the state
tracking required for a single serialization job that may itself be
comprised of multiple actions and may need configuring depending on the
specific context in which we are serializing data.

These changes have also been highlighting the confusing role or RutAsset
objects. Assets let us track the original file path associated with some
data that was imported into Rig, as well as a thumbnail and user tags.
Assets are getting used as a general container for textures and meshes
though which is especially awkward in the context of the simulator
process where we don't need thumbnails and it's also really bad that we
repeatedly derive mesh data from assets instead of storing and
serializing the final derived data.
interfaces: split out graphable into seperate files
engine: make into an ref-counted object

Given how we want to use the RutProperty infrastructure for
synchronizing simulator work with the frontend process it helps if
everything that has associated properties is a fully-fledged RutType
instance so that we can implement debugging facilities that can trace
property changes, printing the types of all objects being changed for
example.
memory-stack: _memalign(), free sub-stacks, _foreach_region()

This adds support for aligned stack allocations via a new
rut_memory_stack_memalign() function which takes an additional alignment
argument. This new function and rut_memory_stack_alloc() are now
declared as static inline functions in rut-memory-stack.h and they share
a _rut_memory_stack_alloc_in_next_sub_stack() function for the cases
where the allocation doesn't simply fit in the current sub-stack.

rut_memory_stack_rewind() now also frees all but the largest sub-stack
which should help reduce memory fragmentation.

A new rut_memory_stack_foreach_region() api has been added for iterating
through all data currently stored in a stack which is just a small
utility for iterating the sub-stacks up-until the current sub-stack
and passing a pointer and size for each sub-stack to a given callback.
Support new github upstream for protobuf-c

The protobuf-c maintainers changed recently and it is now hosted on
github. This updates Rig to build with the latest version on github.
Since the upsream now better differentiates the protobuf-c library from
the protobuf-c-rpc code and since we already had our own copy of most of
the rpc related code under rig/jni/protobuf-c this takes a copy of the
remaining bits (the dispatch apis) so that we don't need to depend on
building the rpc code from upstream.
remove the rig/jni sub-directory

The jni/ directory was put in place when adding Android build support
for Rig, but the plan for updating our Android support is that we will
only be supporting building Rig in device mode and that we will support
building at runtime using the user's chosen Android NDK. This means the
necessary source will be available at runtime and we will have full
control over its layout without needing to affect the source code layout
of this repo.