Feature or enhancement
The curses module exposes most of the X/Open mouse interface (getmouse, ungetmouse, mousemask, mouseinterval, and window.enclose), but two functions are missing.
has_mouse() returns whether the mouse driver has been successfully initialized. It complements mousemask()/getmouse() and fits the existing has_colors/has_ic/has_il/has_key family.
wmouse_trafo() transforms a coordinate pair between window-relative and stdscr-relative space (the two differ when lines are reserved on the screen via ripoffline() or slk_init()). It is the companion of window.enclose() for interpreting mouse-event coordinates.
Proposed API:
curses.has_mouse()->boolwindow.mouse_trafo(y, x, to_screen)->(y, x)orNone
to_screen=True converts window-relative coordinates to stdscr-relative, False does the reverse. The method returns the converted coordinates, or None when the point lies outside the window (the failure case of wmouse_trafo()).
A module-level mouse_trafo() is not needed: in ncurses it is just wmouse_trafo(stdscr, ...), so stdscr.mouse_trafo(...) already covers it, consistent with window.enclose() (there is no module-level enclose() either).
Both are guarded by NCURSES_MOUSE_VERSION, like window.enclose().