I'm trying to write a gui, as it will be drawn by skia or cairo, I know that they are used to draw GUI elements only and have nothing to do with receiving events, so I will use another library for that. I wanted to know:
How to detect whether the mouse cursor has become inside the widget, such as the rounded rectangle button, the normal rectangular button, the ellipse, the circle, and a graph under a curve...etc?
I know about some possible algorithms such as determining the widget's coordinates and determining its area, mathematically, or using the widget's color so that the event is triggered when the mouse pointer is on the widget's color, but I think the actual method used in common GUIs is different from that.
Where is the mouse pointer event listener placed? Does each widget have its own event listener, or is it associated with the parent of each widget, or is there only one event listener responsible for receiving any event when a widget interacts with the mouse pointer?
I searched on the net, but didn't find much detail on the subject.