uses
Windows, Classes, SysUtils,
IdHTTP, IdComponent, IdGlobal, IdException,
- GikoSystem, BoardGroup, AbonUnit;
+ AbonUnit;
type
// TThreadItem \82Ì\83v\83\8d\83p\83e\83B\90Ý\92è\81^\8eæ\93¾ ID
tipScrollTop, // : Integer // \83X\83N\83\8d\81[\83\8b\88Ê\92u
tipDownloadHost, // : string // \8d¡\82Ì\83z\83X\83g\82Æ\88á\82¤\8fê\8d\87\82Ì\83z\83X\83g
tipAgeSage, // : TThreadAgeSage // \83A\83C\83e\83\80\82Ì\8fã\82°\89º\82°
- tipURL // : string // \83X\83\8c\83b\83h\82ð\83u\83\89\83E\83U\82Å\95\\8e¦\82·\82é\8dÛ\82Ì URL
+ tipURL, // : string // \83X\83\8c\83b\83h\82ð\83u\83\89\83E\83U\82Å\95\\8e¦\82·\82é\8dÛ\82Ì URL
+ tipFilePath // : string // \82±\82Ì\83X\83\8c\82ª\95Û\91¶\82³\82ê\82Ä\82¢\82é\83p\83X
);
// *************************************************************************
var outRevision : DWORD // \83\8a\83r\83W\83\87\83\93\83i\83\93\83o\81[
); stdcall;
+ // *************************************************************************
+ // \8ew\92è\82µ\82½ URL \82ð\82±\82Ì\83v\83\89\83O\83C\83\93\82Å\8eó\82¯\95t\82¯\82é\82©\82Ç\82¤\82©
+ // *************************************************************************
+ TOnAcceptURL = function(
+ inURL : PChar // \94»\92f\82ð\8bÂ\82¢\82Å\82¢\82é URL
+ ): Boolean; stdcall; // \8eó\82¯\95t\82¯\82é\82È\82ç True
+
+ // *************************************************************************
+ // TThreadItem \82ª\90¶\90¬\82³\82ê\82½
+ // *************************************************************************
+ TThreadItemCreate = procedure(
+ inInstance : DWORD
+ ); stdcall;
+
+ // *************************************************************************
+ // TThreadItem \82ª\94j\8aü\82³\82ê\82½
+ // *************************************************************************
+ TThreadItemDispose = procedure(
+ inInstance : DWORD
+ ); stdcall;
+
+
+
// =========================================================================
// \83v\83\89\83O\83C\83\93\82ð\8aÇ\97\9d\82·\82é TBoardPlugin \83N\83\89\83X
// =========================================================================
TBoardPlugIn = class( TObject )
private
- FFilePath : string; // \83v\83\89\83O\83C\83\93\82ð\8e¦\82·\83p\83X
- FModule : HMODULE; // \83v\83\89\83O\83C\83\93\82Ì\83\82\83W\83\85\81[\83\8b\83n\83\93\83h\83\8b
+ FFilePath : string; // \83v\83\89\83O\83C\83\93\82ð\8e¦\82·\83p\83X
+ FModule : HMODULE; // \83v\83\89\83O\83C\83\93\82Ì\83\82\83W\83\85\81[\83\8b\83n\83\93\83h\83\8b
- FVersionInfo : TOnVersionInfo;
+ FVersionInfo : TOnVersionInfo;
+ FAcceptURL : TOnAcceptURL;
+ FCreateThreadItem : TThreadItemCreate;
+ FDisposeThreadItem : TThreadItemDispose;
public
// \83v\83\89\83O\83C\83\93\82Ì\83p\83X\82ð\8ew\92è\82µ\82Ä\8dì\90¬
procedure VersionInfo( var outAgent : string;
var outMajor : DWORD; var outMinor : DWORD;
var outRelease : string; var outRevision : DWORD );
+ // \8ew\92è\82µ\82½ URL \82ð\82±\82Ì\83v\83\89\83O\83C\83\93\82Å\8eó\82¯\95t\82¯\82é\82©\82Ç\82¤\82©
+ function AcceptURL( inURL : string ) : Boolean;
+ procedure CreateThreadItem( threadItem : DWORD );
+ procedure DisposeThreadItem( threadItem : DWORD );
private
procedure LoadPlugInAPI;
public
- property FilePath : string read FFilePath;
- property Module : HMODULE read FModule;
+ property FilePath : string read FFilePath;
+ property Module : HMODULE read FModule;
end;
var
BoardPlugIns : array of TBoardPlugIn;
+procedure InitializeBoardPlugIns;
+
function CreateResultString(
resultStr : string
) : PChar; stdcall;
implementation
+uses GikoSystem, BoardGroup;
+
+// =========================================================================
+// \83v\83\89\83O\83C\83\93\82ð\8aÇ\97\9d\82·\82é TBoardPlugin \83N\83\89\83X
+// =========================================================================
+
+// *************************************************************************
+// BoardPlugin \83t\83H\83\8b\83_\82É\82 \82é\83v\83\89\83O\83C\83\93\82ð\91S\82Ä\83\8d\81[\83h
+// *************************************************************************
+procedure InitializeBoardPlugIns;
+var
+ i, bound : Integer;
+ pluginNames : TStringList;
+begin
+
+ pluginNames := TStringList.Create;
+ try
+ GikoSys.GetFileList( GikoSys.Setting.GetBoardPlugInDir, '*', pluginNames, False, False );
+ SetLength( BoardPlugIns, pluginNames.Count );
+
+ bound := pluginNames.Count - 1;
+ for i := 0 to bound do
+ BoardPlugIns[ i ] := TBoardPlugIn.CreateFromName( pluginNames.Strings[ i ] );
+ finally
+ pluginNames.Free;
+ end;
+
+end;
+
+
+
// =========================================================================
// \83v\83\89\83O\83C\83\93\82ð\8aÇ\97\9d\82·\82é TBoardPlugin \83N\83\89\83X
// =========================================================================
end;
// *************************************************************************
+// \8ew\92è\82µ\82½ URL \82ð\82±\82Ì\83v\83\89\83O\83C\83\93\82Å\8eó\82¯\95t\82¯\82é\82©\82Ç\82¤\82©
+// *************************************************************************
+function TBoardPlugIn.AcceptURL(
+ inURL : string
+) : Boolean;
+begin
+
+ if Assigned( FAcceptURL ) then
+ Result := FAcceptURL( PChar( inURL ) )
+ else
+ Result := False;
+
+end;
+
+// *************************************************************************
+// TThreadItem \82ª\90¶\90¬\82³\82ê\82½
+// *************************************************************************
+procedure TBoardPlugIn.CreateThreadItem(
+ threadItem : DWORD
+);
+begin
+
+ if Assigned( FCreateThreadItem ) then
+ FCreateThreadItem( threadItem );
+
+end;
+
+// *************************************************************************
+// TThreadItem \82ª\94j\8aü\82³\82ê\82½
+// *************************************************************************
+procedure TBoardPlugIn.DisposeThreadItem(
+ threadItem : DWORD
+);
+begin
+
+ if Assigned( FDisposeThreadItem ) then
+ FDisposeThreadItem( threadItem );
+
+end;
+
+// *************************************************************************
// \83v\83\89\83O\83C\83\93\82Ì API \82ð\8eæ\93¾
// *************************************************************************
procedure TBoardPlugIn.LoadPlugInAPI;
try
if Assigned( Pointer( FModule ) ) then begin
- FVersionInfo := GetProcAddress( FModule, 'OnVersionInfo' );
+ FVersionInfo := GetProcAddress( FModule, 'OnVersionInfo' );
+ FAcceptURL := GetProcAddress( FModule, 'OnAcceptURL' );
+ FCreateThreadItem := GetProcAddress( FModule, 'ThreadItemCreate' );
+ FDisposeThreadItem := GetProcAddress( FModule, 'ThreadItemDispose' );
end;
except
end;
httpSocket := TIdHTTP.Create( nil );
try
-
// \83C\83x\83\93\83g\82Ì\90Ý\92è
if Assigned( OnWork ) then
httpSocket.OnWork := OnWork;
if Assigned( OnWorkEnd ) then
httpSocket.OnWorkEnd := OnWorkEnd;
+ // \92Ê\90M\82É\8aÖ\82·\82é\90Ý\92è
httpSocket.Request.CustomHeaders.Clear;
+ httpSocket.Response.Clear;
+ httpSocket.Request.Clear;
+
+ httpSocket.Request.UserAgent := GikoSys.GetUserAgent;
+ httpSocket.RecvBufferSize := Gikosys.Setting.RecvBufferSize;
+ httpSocket.ProxyParams.BasicAuthentication := False;
+ {$IFDEF DEBUG}
+ Writeln('------------------------------------------------------------');
+ {$ENDIF}
+ //httpSocket.AllowCookies := False;
+ if GikoSys.Setting.ReadProxy then begin
+ if GikoSys.Setting.ProxyProtocol then
+ httpSocket.ProtocolVersion := pv1_1
+ else
+ httpSocket.ProtocolVersion := pv1_0;
+ httpSocket.ProxyParams.ProxyServer := GikoSys.Setting.ReadProxyAddress;
+ httpSocket.ProxyParams.ProxyPort := GikoSys.Setting.ReadProxyPort;
+ httpSocket.ProxyParams.ProxyUsername := GikoSys.Setting.ReadProxyUserID;
+ httpSocket.ProxyParams.ProxyPassword := GikoSys.Setting.ReadProxyPassword;
+ if GikoSys.Setting.ReadProxyUserID <> '' then
+ httpSocket.ProxyParams.BasicAuthentication := True;
+ {$IFDEF DEBUG}
+ Writeln('\83v\83\8d\83L\83V\90Ý\92è\82 \82è');
+ Writeln('\83z\83X\83g: ' + GikoSys.Setting.ReadProxyAddress);
+ Writeln('\83|\81[\83g: ' + IntToStr( GikoSys.Setting.ReadProxyPort ));
+ {$ENDIF}
+ end else begin
+ if GikoSys.Setting.Protocol then
+ httpSocket.ProtocolVersion := pv1_1
+ else
+ httpSocket.ProtocolVersion := pv1_0;
+ httpSocket.ProxyParams.ProxyServer := '';
+ httpSocket.ProxyParams.ProxyPort := 80;
+ httpSocket.ProxyParams.ProxyUsername := '';
+ httpSocket.ProxyParams.ProxyPassword := '';
+ {$IFDEF DEBUG}
+ Writeln('\83v\83\8d\83L\83V\90Ý\92è\82È\82µ');
+ {$ENDIF}
+ end;
+
httpSocket.Request.ContentRangeStart := inRangeStart;
httpSocket.Request.ContentRangeEnd := inRangeEnd;
if (ioModified <> 0) and (ioModified <> ZERO_DATE) then
Result := DWORD( threadItem.AgeSage );
tipURL: // : string // \83X\83\8c\83b\83h\82ð\83u\83\89\83E\83U\82Å\95\\8e¦\82·\82é\8dÛ\82Ì URL
Result := DWORD( CreateResultString( threadItem.URL ) );
+ tipFilePath: // \82±\82Ì\83X\83\8c\82ª\95Û\91¶\82³\82ê\82Ä\82¢\82é\83p\83X
+ Result := DWORD( CreateResultString( threadItem.FilePath ) );
else
Result := 0;
end;
tipNo: // : Integer // \94Ô\8d\86
threadItem.No := param;
tipFileName: // : string // \83X\83\8c\83b\83h\83t\83@\83C\83\8b\96¼
- begin
threadItem.FileName := string( PChar( param ) );
- DisposeResultString( PChar( param ) );
- end;
tipTitle: // : string // \83X\83\8c\83b\83h\83^\83C\83g\83\8b
- begin
threadItem.Title := string( PChar( param ) );
- DisposeResultString( PChar( param ) );
- end;
tipCount: // : Integer // \83X\83\8c\83b\83h\83J\83E\83\93\83g\81i\83\8d\81[\83J\83\8b\81j
threadItem.Count := param;
tipAllResCount: // : Integer // \83X\83\8c\83b\83h\83J\83E\83\93\83g\81i\83T\81[\83o\81j
tipRound: // : Boolean // \8f\84\89ñ\83t\83\89\83O
threadItem.Round := Boolean( param );
tipRoundName: // : string // \8f\84\89ñ\96¼
- begin
threadItem.RoundName := string( PChar( param ) );
- DisposeResultString( PChar( param ) );
- end;
tipIsLogFile: // : Boolean // \83\8d\83O\91¶\8dÝ\83t\83\89\83O
threadItem.IsLogFile := Boolean( param );
tipKokomade: // : Integer // \83R\83R\82Ü\82Å\93Ç\82ñ\82¾\94Ô\8d\86
tipScrollTop: // : Integer // \83X\83N\83\8d\81[\83\8b\88Ê\92u
threadItem.ScrollTop := param;
tipDownloadHost: // : string // \8d¡\82Ì\83z\83X\83g\82Æ\88á\82¤\8fê\8d\87\82Ì\83z\83X\83g
- begin
threadItem.DownloadHost := string( PChar( param ) );
- DisposeResultString( PChar( param ) );
- end;
tipAgeSage: // : TThreadAgeSage // \83A\83C\83e\83\80\82Ì\8fã\82°\89º\82°
threadItem.AgeSage := TGikoAgeSage( param );
tipURL: // : string // \83X\83\8c\83b\83h\82ð\83u\83\89\83E\83U\82Å\95\\8e¦\82·\82é\8dÛ\82Ì URL
- begin
threadItem.URL := string( PChar( param ) );
- DisposeResultString( PChar( param ) );
- end;
+ tipFilePath: // : string // \82±\82Ì\83X\83\8c\82ª\95Û\91¶\82³\82ê\82Ä\82¢\82é\83p\83X
+ threadItem.FilePath := string( PChar( param ) );
end;
end;