Changes between Version 3 and Version 4 of libroar/plugins

03/20/12 14:23:51 (10 years ago)

Added infos about common services


  • libroar/plugins

    v3 v4  
    1818The Plugin Container is a separate module. It can store multiple plugins at the same time and makes it easy for an application to handle them. A application using the container does not need to keep a list of plugins or send events to them individually but just pass the stuff to the container. 
     20= Common Services = 
     21The plugin API provides some common services as found in a lot application specific plugin interfaces. 
     23== AppSched == 
     24The AppSched is a way to allow the plugin to run event independed code. For example if the plugin copies data from one to another location AppSched is used to do that job. It is normally used to implement a main loop like structure. 
     26AppSched works by registering callbacks for special events. The following events are defined: 
     28||= Event =||= Description =|| 
     29||INIT     ||This is called when the application wants to start the plugin. Normally you run code to open IO or build data structures here. || 
     30||FREE     ||This is called when the plugin is no longer used (on unload). You normally close all your IO and free memory you allocated here. || 
     31||UPDATE   ||This is called when you should do a main loop iteration. You can check your IO here and do your work. This function must not block. This is normally called once per main loop cycle of the host application. || 
     32||TICK     ||This is a an asynchronous event. Some applications use it when doing some longer work. It can be used to sync your IO like answer re-draw requests from the X server. You must not block in this function. || 
     33||WAIT     ||This is to ask the plugin to block and wait for new work to be done. This is normally used to wait for new IO events such as data from clients or X11 events. This can block for a long time. UPDATE is called soon after this returned so you do not need to call it from here. || 
     35== Context separation == 
     36The Plugin API supports context separation. This means that the plugin runs in it's own context and will not see the context of the host application or of other plugins. This also allows the same plugin to be loaded multiple times without them interacting. 
     38The following is currently supported context separation: 
     39* libroar's error state 
     40* system's error state 
     41* global data of the plugin 
     42* global notify core 
    2044= List of Subtopics =