This is for Python, perhaps something can be found for another language..
From the update-manager source, UnitySupport.py:
You need to:
from gi.repository import Dbusmenu, Unity
to get Unity support.
You can then define a function:
def set_launcher_icon_num(self, num_count):
self._unity.set_property("count", num_count)
if num_count > 0:
self._unity.set_property("count-visible", True)
else:
self._unity.set_property("count-visible", False)
Also, to show urgency(shake the icon),
self._unity.set_property("urgent", urgent)
or to create a progressbar,
self._unity.set_property("progress", progress/100.0)
where progress is from 0 to 100. You can then use:
self._unity.set_property("progress_visible", True)
to show the progressbar and use False instead of True to hide it.
As always, searching the source of a program that does what you are trying to do can be worthwhile.
These are subject to change at anytime. You can also see the Unity API.