You inform ImageGear of each callback function that you want it to call by specifying a pointer to that function as an argument in a call to an IG_...() function. The ImageGear functions that include at least one callback are:
- IG_load_file_display()
- IG_file_IO_register()
- IG_load_tag_CB_register()
- IG_save_tag_CB_register()
- IG_status_bar_CB_register()
Some callbacks are registered with special registration calls while others are passed in as arguments to normal API calls. The reason for this is that some callbacks need to be called during more than one ImageGear process. Callbacks of this nature will generally be registered with a special registering function (which includes the word "register") and called by ImageGear behind the scenes.
Other callbacks whose function is limited to just one API call will be passed in as an argument, such as LPFNIG_GUITHUMBCOMP, which is called by IG_GUI_thumbnail_sort().
These callbacks are often essential to the completion of their host function. For example, LPFNIG_GUITHUMBCOMP makes the decision on how thumbnails are sorted. Without it no sorting will take place.
If you've registered a callback function using an IG_ ..._CB_register() function, you can un-register it by calling the function again, and supplying a NULL in place of the pointer to the callback function. |
In each case, the IG_...() function's description in "Core Component API Function Reference" chapter describes what type the callback function must be. This refers to the argument sequence with which ImageGear is going to call that particular callback function.