

[ ] add the "get it on f-droid" badge with the link to the app



Roadmap:
    - 0.1.6:
    [ ] Put all known applications using Termux:GUI in the readme, I made quite a few by now
    [x] protobuf documentation
    [ ] update the f-droid metadata
        [ ] write a changelog
        [ ] update description and readme
    - 1.0.0: !!! start semantic versioning from here !!!
        [ ] switch to the new plugin system, deprecate shared uid
        [ ] add more logging
        [ ] C library 1.0
            [ ] add error codes from protobuf to C library
            [/] finish tutorial
        [ ] button in settings to save a logcat dump to a file
        [?] RelativeLayout
            [ ] good ConstraintLayout support accomplishes the same
        [ ] ConstraintLayout
        [ ] scroll events
        [ ] Dialogs in DialogFragments, so they stay in the Activity they're started in and don't close on leaving
        [?] add the ability to intercept touch events in layouts
        [ ] events for PiP action buttons
        [ ] make the readme nicer
        [ ] add Javadocs
        [ ] update the f-droid metadata
            [ ] write a changelog
            [ ] more screenshots
            [ ] update description and readme
    - 1.1.0
        [ ] add methods for android 12 widget api
            [ ] settable margins and paddings
            [ ] better dynamic RemoteViews
            [ ] Stateful widgets
            [ ] prepopulated collections views
            [ ] material you theming
        [ ] update the f-droid metadata
            [ ] write a changelog
            [ ] more screenshots
            [ ] update description and readme
    - 1.2.0:
        [ ] remove shared uid
        [ ] additional argument to methods that require a View: subtree: id of a ViewGroup that contains the View as a child, grandchild, ... .
            The id gets looked up once and cached in a Hashmap (delete when view is removed).
            Future methods with the same subtree argument can then use the cached value and don't have to traverse the whole View tree.
            [ ] also add the subtree id to the events, so the client can do the same optimisation when processing events
            [ ] or just keep all Views in a HashMap
        [ ] Enable method batching, multiple requests are send in the same message and are all enqueued on the main thread as one.
            Result messages are then returned in the order the messages were send.
            [ ] or a new transaction-based api 
        [ ] Add a method to create a view tree from a representation. The view ids are returned from a flattened version of the tree.
            [ ] add more arguments to the create messages like the tab/spinner list, so this is the only message you need to send to set up a full layout.
        [ ] update the f-droid metadata
            [ ] write a changelog
            [ ] more screenshots
            [ ] update description and readme
    
    Maybe in the future:
    - tooltip/context menus
    - action bar with configurable actions
    [ ] fragment connections
        [ ] make a method to check if it's a fragment connection
        [ ] use 0-0 as the dummy activity id for the activity the fragment connection is in.
        [ ] option for the fragment to emit events to it's embedder, and for the embedder to "call" methods in the fragment
        [ ] as an optimisation, put all views and the ids in a HashMap, and let findView use that map. It's faster than searching the view tree and main and fragment connections can have different Maps.




idea: use vulkan to create a buffer and create a file descriptor for it, use the buffer in opengl to draw to a GL SurfaceView and pass the file descriptor to the program, so it can also map it.
That consumes no cpu memory and allows the program to use accelerated graphics in the buffer.

Android doesn't support the extension to export a buffer as a fd, look into EGL instead.
https://source.android.com/devices/graphics/arch-egl-opengl?hl=en
https://www.khronos.org/registry/EGL/specs/eglspec.1.5.pdf
https://www.khronos.org/registry/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf

Turns out sharing between processes isn't in the scope of EGL.
Look at the android-specific interfaces instead.
You can use hardware buffers with the ndk
To make a c program use AHardwareBuffer: -target arch-linux-android26 -landroid
https://developer.android.com/ndk/reference/group/a-hardware-buffer#ahardwarebuffer_recvhandlefromunixsocket
https://medium.com/@spencerfricke/android-ahardwarebuffer-shared-memory-over-unix-domain-sockets-7b27b1271b36
https://github.com/sjfricke/NDK-Socket-IPC

https://developer.android.com/guide/topics/graphics/opengl
https://developer.android.com/ndk/guides/graphics/getting-started










[ ] idea: Fragment connections: create a child connection whose root View is a FrameLayout in the current hierarchy.
    - the child connection doesn't count as a full connection and can't create it's own activities or overlays. For that the child has to create a completely new connection.
    - child connections get closed when the parent closes.
    - a method the get the fragment activity id. That will be a virtual activity id, because all view methods need an activity to act on.
    - fragment connections can send events to the parent connection. The event will be reported as from the id of the layout of the parent of the fragment
    - also a method to send custom messages to fragments. That enables a full 2-way communication
    - This system allows you to transparently use other programs as custom views in you layout, by creating a configured fragment connections, setting the fd to not close on exec, exec the program and pass the fd number as a parameter
    - nesting should be supported.
        - Views in Fragments can still be found from the Parent activity. Make a custom findViewById that doesn't search Fragments, also for performance reasons






