Changes between Version 3 and Version 4 of libroar/plugins


Ignore:
Timestamp:
03/20/12 14:23:51 (10 years ago)
Author:
ph3-der-loewe
Comment:

Added infos about common services

Legend:

Unmodified
Added
Removed
Modified
  • 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. 
    1919 
     20= Common Services = 
     21The plugin API provides some common services as found in a lot application specific plugin interfaces. 
     22 
     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. 
     25 
     26AppSched works by registering callbacks for special events. The following events are defined: 
     27 
     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. || 
     34 
     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. 
     37 
     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 
     43 
    2044= List of Subtopics = 
    2145