need help trying to implement realtime alignment/snapping on layers bounding boxes (aka Smart Guides)
I'm trying to implement realtime alignment/snapping on layers bounding boxes (aka smart guides) which is requested by the issue #1854 (closed) and the community in general something like inkscape does
https://www.youtube.com/watch?v=pLbtQux5jZY (for privacy use invidious proxy https://redirect.invidious.io/watch?v=pLbtQux5jZY)
and I have minimal working example implemented in GTK with cairo in the attachment
my problem is that I'm in the [gimp/app/core/gimpimage-snap.c] code trying to iterate over the layers but I don't know how becuase when I use [gimp_image_get_layers(image);] inside [gimp_image_snap_x] function I suppose I get the layers list and yes calling int [gimp_container_get_n_children(container);] gives the correct number of layers when I try to reterive the layer with:
GimpLayer *layer = gimp_container_get_child_by_index (container, i);
and call any function on it like [gimp_layer_get_opacity(layer)] I get segfault
So I'm asking what is the way to iterate over layers inside /app/core? because I see two [gimp_image_get_layers] functions one supposedly belong to gimp-pdb public interface for scripting and other for internal use.