From: Elio C. G. <el...@us...> - 2005-02-16 05:24:07
|
Update of /cvsroot/davinci/davinci/sdk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14571 Added Files: dvplugin.pas Log Message: SDK - Work in progress. --- NEW FILE: dvplugin.pas --- { Copyright (C) 2004 DaVinci Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } { This unit is part of the DaVinci Universal IDE Software Development Kit. It has all the required types and functions to create DaVinci plugins and to register functions and shared variables with with DaVinci. } unit dvplugin; {$mode objfpc}{$H+} interface uses Classes, SysUtils; type { Includes SDK shared types } {$I sdktypes} { Plugin exceptions } EPluginSystemNotInitialized=class(Exception); { This procedure must be called in the plugin's Start method to register the functions it exports. } procedure RegisterFunction(Fun: TPluginFunction); { Enables plugin's shared variables. Use with caution! } procedure RegisterInteger(var Variable: Integer); { This function is to be called internally by DaVinci. You must export this funtion in your plugin in order to work. } procedure InitializePluginSystem(FunTableAddAddress: TDVFunTableAdd; VarTableAddAddress: TDVVarTableAdd); implementation var FunTableAdd: TDVFunTableAdd; VarTableAdd: TDVVarTableAdd; procedure InitializePluginSystem(FunTableAddAddress: TDVFunTableAdd; VarTableAddAddress: TDVVarTableAdd); begin FunTableAdd := FunTableAddAddress; VarTableAdd := VarTableAddAddress; end; procedure RegisterFunction(Fun: TPluginFunction); begin if Assigned(FunTableAdd) then FunTableAdd(Fun) else raise EPluginSystemNotInitialized.Create('Plugin system not initialized!'); end; procedure RegisterInteger(var Variable: Integer); begin if Assigned(VarTableAdd) then VarTableAdd(Variable) else raise EPluginSystemNotInitialized.Create('Plugin system not initialized!'); end; end. |