Writing callback functions in XLib
I want to write a simple graphics library that works on top of XLib(as a term project). And I want to provide an abstract keyboard and mouse handling support. But XLib handles these as events, so a typical event-handling routine would be:
I can't use code like this in my library, so I think I will have to write a callback function for the events. So how do I accomplish this? Or is there a way without using callback functions?
XNextEvent( display, &event );
switch( event )