How can I get the visible keyframes in the Dope Sheet editor and their screen coordinates?

I am trying to create a Python script that gives me the current visible keyframes in the Dope Sheet editor and their respective screen coordinates.

image
(Figure 1)

So, for example, in this image (Figure 1), I want my script to print out 18 lines (because there are 9 objects and each object has 2 keyframes), describing each of these keyframes’ screen coordinates or their relative coordinates to the Dope Sheet window.

image
(Figure 2)

And in this example (Figure 2), I want my script to print out 34 lines (notice that the number of objects is the same as in Figure 1, but this time I have expanded the hierarchy for cube.007 and cube.008), including the screen coordinates of each keyframe.

If this information is not accessible from the regular Blender python API, where and how can I get the information from the source code.

Do you want to change the shape of your keyframe icon or expand its visual presentation?