I have a such problem that I don't know if it will be well explained... The question is that I need to collect all X keyboard layouts and variants and I just meet xklavier library. I tried to write an object-oriented test C++ programm (while the project test programm is not object-oriented...) but the compiler (ie, g++) breaks when xkl_config_registry_foreach_language() is called, throwing this message:
....cc: In constructor ‘MyClass::MyClass()’:
....cc: error: argument of type ‘void (Teclat::)(XklConfigRegistry*, const XklConfigItem*, void*)’ does not match ‘void (*)(XklConfigRegistry*, const XklConfigItem*, void*)’
I don't find anywhere an specific xklavier forum to post this question, so I don't know if you can help me. Although, I wonder...
The typical approach is to make the callback function a static member function. This solves
the type mismatch problem, but now you need an instance of the object. Typically it is
passed to the callback via a void* parameter. I don't know the details of the above code,
but I would guess that that is exactly what the void* parameter is for in the callback function.