吉里吉里2 ごった煮プラグイン ver. 0.9.2 β

  1. 何ですか
  2. 動作環境
  3. 使い方
    1. 組み込み
    2. リンク
  4. SQLite コマンドライン・インターフェース
  5. フックスクリプト
    1. リンク時のフックスクリプト
    2. 禁止事項
    3. サンプル
  6. 注意点
    1. KAGで使用する場合
    2. このソフトウェアについて
  7. ライセンス
    1. SQLite関連以外
    2. SQLite関連
  8. オリジナルコード
    1. 吉里吉里2
    2. MD5ライブラリ
    3. SHAライブラリ
    4. RIPEMD160
    5. ユリウス通日変換・タイムゾーン処理
    6. 旧暦計算
    7. SQLiteプラグインとSQLiteコマンドラインインターフェース
    8. 画像処理ルーチン
    9. Punycode変換
    10. 累積分布逆関数
  9. 著作権表示等
    1. MD5
    2. Mersenne Twister (MT19937)
    3. SQLite and SQLitePlus
    4. Punycodeエンコーダ/デコーダ
    5. RIPEMD160 (SSLeay) Original SSLeay License
    6. Julian day (PHP/5.2.0)
    7. Timezone (PHP/5.2.0)
  10. 更新履歴

1. 何ですか

吉里吉里2用プラグインです。下記の関数、クラス等を使用できるようになります。

ほか、SQLite DB用のユーティリティである「SQLite コマンドライン・インターフェース」が付属しています。

2. 動作環境

Windows 2000/XP 上の吉里吉里2 2.26/2.28 で動作します。Windows Server 2003やWindows Vistaでも動くかもしれませんが、試す環境がないため未確認です。

Windows 95/98/Me は動作対象外です。吉里吉里2 2.24 以前も動作対象外です(プラグインのインターフェースが異なるため)。

3. 使い方

組み込み

使用したい機能を提供する各DLLファイル(util_****.dll)を、下記のいずれかのフォルダにコピーしてください。各DLLファイルは lib フォルダにあります。

  1. 吉里吉里本体と同じフォルダ
  2. 吉里吉里本体以下と同じフォルダにある plugin フォルダ内
  3. 自動検索対象パス

util_sqlite.dll(SQLiteインターフェース)

util_sqlite.dll を使用する場合は、sqlite3.dll を吉里吉里本体と同じフォルダ (*1)にコピーしてください。

util_iconv.dll(文字コード変換)

util_iconv.dll を使用する場合、iconv.dll を吉里吉里本体と同じフォルダ (*2)にコピーしてください。iconv.dll は、GNUのFTPミラーサイト等から入手できます。libiconv 1.9.1 のWindows用バイナリアーカイブ(libiconv-1.9.1.bin.woe32.zip 等)に含まれています。

リンク

TJS2ソースコード中で、Plugins.link("util_****.dll");としてプラグインをロードすると、ロードしたプラグインに応じていくつかの関数やクラス等が使えるようになります。

4. SQLite コマンドライン・インターフェース

lib フォルダにある isqlite.exe は、SQLiteデータベースを扱うためのコマンドラインインターフェースです。

コマンドライン上で実行します。プラグインと同様、sqlite3.dll が必要です。isqlite.exe と同じフォルダか、パスの通ったフォルダにsqlite3.dll を置いておく必要があります。

isqlite.exe [-b] DBFile [SQL]

[パラメータ]
	DBFile : SQLite3データベースファイル名
	SQL    : 実行するSQL
[オプション]
	-b     : バッチモードで起動します。
[メモ]
	SQLが指定されなかった場合、あるいは '-' が指定された場合、
	インタラクティブモードで起動します。
	インタラクティブモードでは、.help でヘルプが表示されます。
	バッチモードではプロンプトも結果も出力されません。

5. フックスクリプト

「ごった煮プラグイン」で提供されるプラグインには、プラグインをリンクするときに、特定のスクリプトファイルを実行させる機能があります。このスクリプトをフックスクリプトと呼びます。

リンク時のフックスクリプト

プラグインのリンク時に、メンバが追加された後に実行されます。フックスクリプトのファイル名はutil_***_on_link.tjsです。'***'の部分にはプラグインの名前が入ります。たとえば、util_system.dllをリンクしたときのスクリプトファイル名はutil_system_on_link.tjsとなります (*3)。このファイルを吉里吉里の実行ファイルのあるフォルダに配置しておくと、プラグインがリンクされるときに自動的に読み込まれ、実行されます。ファイルがなければ何もしません。実行に失敗したときには無視してそのまま処理を続けます(吉里吉里は終了しませんし、例外も出しません)。

禁止事項

フックスクリプト中で、別の吉里吉里プラグイン(DLL、TPMファイル)をリンク、またはアンリンクしてはいけません。この場合の動作は未定義です。

サンプル

samples/hook_script フォルダにサンプルがあります。util_system_on_link.tjs は、util_system をリンクした時に実行され、ダイアログを表示します。

6. 注意点

KAGで使用する場合

util_graph.dll を KAG で使用する場合は、Override.tjs でプラグインをリンクしてください。

KAGLayerクラスとそのサブクラスのインスタンスが生成される前にプラグインを組み込んでおかないと、メッセージレイヤ、前景・背景レイヤに、プラグインで追加される Layer のメソッドが適用されません。util_system.dll についても同様です。global.kag に登録されたメニュー項目を、Window.trackPopupMenu 関数を使用してポップアップさせたい場合は、Override.tjs中でプラグインをリンクしてください。

global.kag が生成された後で当プラグインをリンクした場合は、下記のコードを実行すればポップアップできるようになります。

global.kag.trackPopupMenu = Window.trackPopupMenu incontextof global.kag;

なお、この関数は吉里吉里2 2.28/KAG3 3.28では推奨されません。代わりに吉里吉里本体の機能(Menu.popup関数)を使用してください。

このソフトウェアについて

  • Borland C++ Builder 6 で作成し、吉里吉里2 2.26 で動作確認しました。
  • ソースが必要な方は、公開ページから入手してください。
  • 他者のコードを流用しています(後述)。

7. ライセンス

SQLite関連以外

このソフトウェア(SQLite関連を除く)のライセンスは、以下の「The BSD License」に従います。後述の日本語訳は飽くまで参考です。日本語訳にはOpen Source Group Japanで公開されているものを使用しました。

The BSD License 原文

Copyright 2006-2007 mey and other authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the authors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

日本語訳(参考)

ソースコード形式かバイナリ形式か、変更するかしないかを問わず、以下の条件を満たす場合に限り、再頒布および使用が許可されます。

  1. ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、および下記免責条項を含めること。
  2. バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の資料に、上記の著作権表示、本条件一覧、および下記免責条項を含めること。
  3. 書面による特別の許可なしに、本ソフトウェアから派生した製品の宣伝または販売促進に、上記著作者の名前を使用してはならない。

本ソフトウェアは、著作権者およびコントリビューターによって「現状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、および特定の目的に対する適合性に関する暗黙の保証も含め、またそれに限定されない、いかなる保証もありません。著作権者もコントリビューターも、事由のいかんを問わず、損害発生の原因いかんを問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その他の)不法行為であるかを問わず、仮にそのような損害が発生する可能性を知らされていたとしても、本ソフトウェアの使用によって発生した(代替品または代用サービスの調達、使用の喪失、データの喪失、利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害について、一切責任を負わないものとします。

SQLite関連

SQLiteに関わる物、即ち util_sqlite.dll, isqlite.exe, sqlite3.dllとそれらを構成する主たるソースファイル、及び SQLitePlus については、SQLite 及び SQLitePlusのライセンスを尊重し、パブリック・ドメイン・ソフトウェアとします。

8. オリジナルコード

このソフトウェアを作成するにあたり、下記のソースコードを使用・流用・改変しました。

吉里吉里2

下記の吉里吉里2のソースコードを使用、改変しました。

  • TVP Plugin stub: plugins/win32/tp_stub.cpp, plugins/win32/tp_stub.h
  • Complex Rectangle: core/visual/ComplexRect.cpp, core/visual/ComplexRect.h
  • 画像処理テーブル作成: core/visual/glgen/maketab.c
  • 画像処理関数自動生成: graph/gengl4tp.pl, etc.): core/visual/glgen/gengl.pl
  • SVN Revision取得: tool/update_revision_h.pl): core/msg/update_svn_revision.pl
  • Mersenne Twister: common/TPMT19937ar.cpp, .h): core/tjs2/tjsMT19937ar-cok.cpp, core/tjs2/tjsMT19937ar-cok.h, core/tjs2/tjsConfig.cpp

MD5ライブラリ

MD5ライブラリのソースファイル(common/md5.c, .h)にはRFC1321-based (RSA-free) MD5 library(ver. 2002/04/13)を使用しました。

SHAライブラリ

SHAライブラリ(common/GflSHA.cpp, .h)にはSHA(Secure Hash Algorithm)(SYN氏)を改変したものを使用しました。

RIPEMD160

RIPEMD160のソースファイル(common/rmd_dgst.c, ripemd.h, rmd_locl.h, rmdconst.h, md32_common.h)にはSSLeay(OpenSSL 0.9.7i)のソースファイルを使用しました。ただし、一部不要なインクルード(#include コマンド)を削除してあります。

ユリウス通日変換・タイムゾーン処理

ユリウス通日変換とタイムゾーン処理(generic/JulianDay.cpp, php5_fallbackmap.h, php5_timezonemap.h)には、PHP/5.2.0のソースから抜粋、改変したものを使用しました。

  • /php-5.2.0/ext/calendar/gregor.c
  • /php-5.2.0/ext/date/lib/parse_date.c
  • /php-5.2.0/ext/date/lib/fallbackmap.h
  • /php-5.2.0/ext/date/lib/timezonemap.h

旧暦計算

旧暦計算のコード(generic/LunisolarBase.cpp)は、旧暦計算スクリプト Version 1.5を移植、機能追加したものです。

SQLiteプラグインとSQLiteコマンドラインインターフェース

SQLiteプラグインとSQLiteコマンドラインインターフェースは、SQLite 3.2.7SQLitePlus 3.0.7 (SQLitePlus-3.0.7.cab)を使用・改変したものです。 (*4)

画像処理ルーチン

ペイント部(graph/PaintFunc.cpp, .h)には、ペイントルーチン(Fussy氏)を改変したものを使用しました。

ドロネー三角形分割部(graph/Delaunay.cpp, .h)には、デローニー三角形分割(ぱすてる氏)を改変したものを使用しました。

Punycode変換

Punycodeエンコーダ/デコーダ(Punycode.h)にはPunycodeを使用しました。

累積分布逆関数

累積分布逆関数部(generic/RandomVariate.ncc)は、Python 2.4.2のソース(Lib/random.py)の一部を移植したものです。

9. 著作権表示等

MD5

Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

L. Peter Deutschghost@aladdin.com

Mersenne Twister (MT19937)

A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto.

Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length).

Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Any feedback is very welcome.

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html

email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)

SQLite and SQLitePlus

The author disclaims copyright to this source code.In place of a legal notice, here is a blessing:

  • May you do good and not evil.
  • May you find forgiveness for yourself and forgive others.
  • May you share freely, never taking more than you give.

Punycodeエンコーダ/デコーダ

このソースコードに関する全ての著作権を放棄します。

RIPEMD160 (SSLeay) Original SSLeay License

Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved.

This package is an SSL implementation written by Eric Young (eay@cryptsoft.com). The implementation was written so as to conform with Netscapes SSL.

This library is free for commercial and non-commercial use as long as the following conditions are aheared to. The following conditions apply to all code found in this distribution, be it the RC4, RSA, lhash, DES, etc., code; not just the SSL code. The SSL documentation included with this distribution is covered by the same copyright terms except that the holder is Tim Hudson (tjh@cryptsoft.com).

Copyright remains Eric Young's, and as such any Copyright notices in the code are not to be removed. If this package is used in a product, Eric Young should be given attribution as the author of the parts of the library used. This can be in the form of a textual message at program startup or in documentation (online or textual) provided with the package.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: "This product includes cryptographic software written by Eric Young (eay@cryptsoft.com)" The word 'cryptographic' can be left out if the rouines from the library being used are not cryptographic related :-).
  4. If you include any Windows specific code (or a derivative thereof) from the apps directory (application code) you must include an acknowledgement: "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"

THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The licence and distribution terms for any publically available version or derivative of this code cannot be changed. i.e. this code cannot simply be copied and put under another distribution licence [including the GNU Public Licence.]

Julian day (PHP/5.2.0)

Copyright 1993-1995, Scott E. Lee, all rights reserved. Permission granted to use, copy, modify, distribute and sell so long as the above copyright and this permission statement are retained in all copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.

Timezone (PHP/5.2.0)

Copyright (c) 1997-2006 The PHP Group

-------------------------------------------------------------------- 
                  The PHP License, version 3.01
Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
-------------------------------------------------------------------- 

Redistribution and use in source and binary forms, with or without modification, is permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. The name "PHP" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact group@php.net.
  4. Products derived from this software may not be called "PHP", nor may "PHP" appear in their name, without prior written permission from group@php.net. You may indicate that your software works in conjunction with PHP by saying "Foo for PHP" instead of calling it "PHP Foo" or "phpfoo"
  5. The PHP Group may publish revised and/or new versions of the license from time to time. Each version will be given a distinguishing version number. Once covered code has been published under a particular version of the license, you may always continue to use it under the terms of that version. You may also choose to use such covered code under the terms of any subsequent version of the license published by the PHP Group. No one other than the PHP Group has the right to modify the terms applicable to covered code created under this License.
  6. Redistributions of any form whatsoever must retain the following acknowledgment: "This product includes PHP software, freely available from <http://www.php.net/software/>".

THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals on behalf of the PHP Group.

The PHP Group can be contacted via Email at group@php.net.

For more information on the PHP Group and the PHP project, please see <http://www.php.net>.

PHP includes the Zend Engine, freely available at <http://www.zend.com>.

10. 更新履歴

付属のファイル(CHANGES)をご覧ください。