If you want to use an API, you can also use filter_get_active_in_context from lib/filterlib.php. I think that method was used in the equation editor in order to make it compatible with third party TeX filters.
Text editors
Hiding Atto icon when filter not enabled
This discussion has been locked so you can no longer reply to it.