1 /* 2 * This program is free software; you can redistribute it and/or modify 3 * it under the terms of the GNU General Public License as published by 4 * the Free Software Foundation; either version 2 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software 14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 * 16 * Copyright (C) 2006-2016 XNeur Team 17 * 18 */ 19 20 #ifndef _PLUGIN_H_ 21 #define _PLUGIN_H_ 22 23 #include <X11/XKBlib.h> 24 25 #include "xnconfig.h" 26 27 struct _plugin_functions 28 { 29 void *module; 30 31 void (*on_init)(void); 32 void (*on_fini)(void); 33 34 void (*on_xneur_start)(void); 35 void (*on_xneur_reload)(void); 36 void (*on_xneur_stop)(void); 37 void (*on_key_press)(KeySym key, int modifier_mask); 38 void (*on_key_release)(KeySym key, int modifier_mask); 39 void (*on_hotkey_action)(enum _hotkey_action ha); 40 void (*on_change_action)(enum _change_action ca); 41 void (*on_plugin_reload)(void); 42 void (*on_plugin_configure)(void); 43 void (*on_plugin_about)(void); 44 void (*on_plugin_info)(void); 45 }; 46 47 struct _plugin 48 { 49 struct _plugin_functions *plugin; 50 int plugin_count; 51 52 void (*xneur_start) (struct _plugin *p); 53 void (*xneur_reload) (struct _plugin *p); 54 void (*xneur_stop) (struct _plugin *p); 55 void (*key_press) (struct _plugin *p, KeySym key, int modifier_mask); 56 void (*key_release) (struct _plugin *p, KeySym key, int modifier_mask); 57 void (*hotkey_action) (struct _plugin *p, enum _hotkey_action ha); 58 void (*change_action) (struct _plugin *p, enum _change_action ca); 59 void (*plugin_reload) (struct _plugin *p); 60 void (*plugin_configure) (struct _plugin *p); 61 void (*plugin_about) (struct _plugin *p); 62 void (*plugin_info)(struct _plugin *p); 63 64 void (*add) (struct _plugin *p, char* plugin_name); 65 void (*uninit) (struct _plugin *p); 66 }; 67 68 struct _plugin* plugin_init(void); 69 70 #endif /* _PLUGIN_H_ */ 71