KLIRIK.NAROD.RU > MAIN ДОБАВИТЬ В ИЗБРАННОЕ | ПОМОЩЬ
 [ Главная ] [ Лютеранство ] [ Полезности ] [ Гуделки ] [ Ссылки ] [ Форум ] [ Гостевая ] [ Автора! ]  
 

Plugins for The Bat! !

Last Update:

Zakladki.ru

Add site:

Your archive:

Ваш персональный архив на Закладках.ru

Другие места

Site map>

Add a feedback>

Discuss on forum>

Letter to author>

 

Programming of plugins for The Bat!

Russian version here >>>

Official documentation (CP-API) - from RitLabs

Here you can download the official documentation for plugins for The Bat! which was published 10.09.2003 by Ritlabs (archive contains RTF in english)

Russian translation of CP-API - from me ;)

The file you can found here is the russian translation of the official documentation CP-API.

Since the translation itself is not official, I decided that it is useful to clean-up some typerrs (like two sections 5.2.1, accident alias of TBP_NeedConfig into TBP_ConfigNeeded and finaly, confusion with the constants in the section 5.3.3 - this very error was corrected with participation of RITLABS, but was not yet published as fixed one).

Headers for C++

On the basis of official CP-API the header file to be used in CPP was written. Please, note that the file was written in Visual C++, so, you possibly need to adapt this code for your own purposes.

Download the header file (cpapi.zip). (3kb)

The archive contains files cpapi.h andcpapi.def. The first one is the header. The second one - is a list of definitions of exported functions. You may need to include this file in your MS Visual C++ project to avoid so-called "name decorations" when you will compile your plugin.

Simplies plugins-examples

Here you can download the sources of simlies plugins which you can use as examples and small guides when you will develop your own project

RITLNG - the system for plugin's localization.

Currently this system is intended to be used by the authors who use Visual C++ (Delphi, C++ builder is not supported yet).

The system of translation is intended to make easy localization (translation) of interface of plugins to other languages. The working of the system is based on the using of .LNG files - the native for The Bat! extension for localization. So, the translation of plugins to other languages can be completed by partners outsource translators without participation of original developer. All what the developer needs - is to plug the system of translation to his plugin.

The system contains two parts. The first (main) part - is the library to be linked with your plugin. The library and the header file for it you can found in the archive RITLNG, the link is below. There are 4 basic funcions included into library, which are intended to initialize, enumerate available languages, localization and final cleaning up of used resources. The second part of the system - the small utily LNGXtractor - is intended to extract language resources from a compiled plugin. This utily will create source files which you will use witn LNGCompiler to make the final .LNG file with new resources for you plugin. Since this utility also can be applied to the yet-compiled file, this operation can be also completed by translation without original developer (his participation only necessary in the case when the final plugin is compressed - using UPX or any another compressor).

How to plug the system to your plugin? All what you need - is to include the header file to your project, and also plug the library (file .lib) in the options of your compiler.

You also will need to make some changes in the source of your plugin:

  • Add #include "lng.h"
  • In the text of TBP_Initialize (orTBP_SetConfigData, if the parameters of localizatoin will be stored using CP-API) you have to call RITLNG::LNG_OpenRes, and give the full path to language .LNG file for this plugin. If the function returns "true", you can call the next function - RITLNG::LNG_SetLanguage, and give the ID of necessary language to it (all IDs are enumerated in header file).
  • In the text of TBP_Finalize you have to call RITLNG::LNG_Free, which will clean up all used resources before final exiting.

(Look at the header file - it contans some comments!). It is implied that your plugin is written right from the viewpoint of using resources: namely, all dialogs is created using resource editor of Visual Studio (no one is drawing directly using some trick code), and all strings are located in the string resources (i.e. there are no strings which are "encoded" directly in the source code of your plugin, but all strings are loaded from resources using some function like system LoadString). In original version you need to write your plugin in English lagnuage (or some other, but you need that the first 6 letters of any resource don't contain any letters from any locales other than pure latin. This limitation is featured by working of LNGXtractor - since first 6 characters used to make a name for resource variable, it is possible that if you use some local symbols in these positions, LNGCompiler will just fail to open such extracted resources - and so, the plugin couldn't be translated at all. You must definitely define the place where the plugin will seek the .lng file, or make an option which will allow to directly browse this file. Also you need to indicate that the plugin is written with translation system RITLNG (else the translators can make a useless work - since the resources can be extracted by LNGXtractor from any executable file, if this file is not powered by RITLNG the work of translation of such file will be useless).

What translators have to do ?

Using LNGXtractor, which you can found below, you need to extract the resources from ready plugin. Then you must open extracted files (.lnc and .inc) using LNGCompiler (http://sourceforge.net/projects/lngcompiler/) and translate them. Finally, using the same LNGCompiler you can create the file .LNG from your translation - and plug it to the plugin by the method which the author of the plugin must tell you..

Here is the links to the both parts of RITLNG translation system

Some links to the plugins for The Bat!

  • Vampirex (antispam-filter based on keywords filtering with supporting of regular expressions)
  • MyMacros (Some macros for different tasks with source)
  • Bayes Filter Plugin (Open Source) (antispam filter based on Bayes method)
  • BayesIt! (antispam filter based on Bayes method)
  • %IP (don't really know how to call it - the plugin exports the macro %IP which returns a local IP address. Somebody may found it useful). The plugin was originally published at russian forum http://forum.nobat.ru

 


Copyright © 2002, 2003 by Alexey N. Vinogradov (the owner of klirik.narod.ru)
Используются технологии uCoz