Add custom shape into LO Draw via extension

Hello!
I am developing an extension on C++ using UNO API.
And I want to create some custom shapes for my extension. For example, let it be filled circle inside another cricle. I want this shape to behave like a standalone basic shape - it is being drawn via cursor, not just spawned, you can adjust its size and e.t.c. How should I do that?
I found some guides about gallery themes and .fodg formats, but some info looks like outdated.

So, what`s the best way to create a template of a complex custom shape (group of basic shapes) and place it via extension button as any basic LO shape?

I found some guides about gallery themes and .fodg formats, but some info looks like outdated.

You find some general details about custom shapes in
https://wiki.documentfoundation.org/Development/Custom_Shape_Orientation_Guide
Some information about the file format is in book “Custom Shape Tutorial” from
https://documentation.libreoffice.org/en/english-documentation-ii/

You could first create your shape by editing the file format and after that, create such shape by a macro. Of cause you can design you shape directly in a macro as well. I would first do it independent from your extension. For example start with inserting a circle and then change its geometry.

To learn more about custom shapes in the API, insert a custom shape in a document and look at its properties with the Development Tools (menu Tools) or write a minimal macro and look at it in the BASIC IDE. The relevant property is “CustomShapeGeometry”.

Find more hints on Macros - The Document Foundation Wiki

Do you need text in the custom shape in addition?

What is the purpose of your extension? Using C++ is unusual.