entry_ref changes and two new files.
This commit is contained in:
@@ -6,26 +6,19 @@ interface
|
||||
uses
|
||||
DataIO, Path, SupportDefs;
|
||||
|
||||
{.$define SupDefParm}
|
||||
|
||||
function resolve_link(const path : PChar; result : BPath;
|
||||
block : Boolean {$ifdef SupDefParm}= False{$endif})
|
||||
function resolve_link(const path : PChar; result : BPath; block : Boolean {$ifndef VER1_0}= False{$endif})
|
||||
: status_t; cdecl; external 'be' name 'resolve_link__FPCcP5BPathb';
|
||||
|
||||
function write_alias(const path : PChar; s : BDataIO;
|
||||
len : size_t {$ifdef SupDefParm}= nil{$endif})
|
||||
function write_alias(const path : PChar; s : BDataIO; len : size_t {$ifndef VER1_0}= nil{$endif})
|
||||
: status_t; cdecl; external 'be' name 'write_alias__FPCcP7BDataIOPUl';
|
||||
function write_alias(const path : PChar; buf : Pointer; len : size_t)
|
||||
: status_t; cdecl; external 'be' name 'write_alias__FPCcPvPUl';
|
||||
|
||||
function read_alias(s : BDataIO; result : BPath;
|
||||
len : size_t {$ifdef SupDefParm}= nil{$endif};
|
||||
block : Boolean {$ifdef SupDefParm}= False{$endif})
|
||||
function read_alias(s : BDataIO; result : BPath; len : size_t {$ifndef VER1_0}= nil{$endif}; block : Boolean {$ifndef VER1_0}= False{$endif})
|
||||
: status_t; cdecl; external 'be' name 'read_alias__FP7BDataIOP5BPathPUlb';
|
||||
function read_alias(const buf : Pointer; result : BPath; len : size_t;
|
||||
block : Boolean {$ifdef SupDefParm}= False{$endif})
|
||||
function read_alias(const buf : Pointer; result : BPath; len : size_t; block : Boolean {$ifndef VER1_0}= False{$endif})
|
||||
: status_t; cdecl; external 'be' name 'read_alias__FPCvP5BPathPUlb';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
end.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002-2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
@@ -15,74 +17,84 @@
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit entry;
|
||||
unit Entry;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, storagedefs,SupportDefs;
|
||||
BeObj, StorageDefs, SupportDefs;
|
||||
|
||||
type
|
||||
Entry_Ref = record
|
||||
device : dev_t;
|
||||
entry_ref = record
|
||||
device : dev_t;
|
||||
directory : ino_t;
|
||||
name : PChar;
|
||||
end;
|
||||
EntryRef = record
|
||||
device : dev_t;
|
||||
directory : ino_t;
|
||||
name : PChar;
|
||||
end;
|
||||
PEntryRef =^EntryRef;
|
||||
type
|
||||
name : PChar;
|
||||
end;
|
||||
|
||||
Pentry_ref = ^entry_ref;
|
||||
|
||||
BEntry = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create;
|
||||
// constructor Create(dir : BDirectory; path : PChar; traverse : boolean);
|
||||
constructor Create(ref : EntryRef; traverse : boolean);
|
||||
constructor Create(path : PChar; traverse : boolean);
|
||||
constructor Create(ref : entry_ref; traverse : Boolean);
|
||||
constructor Create(path : PChar; traverse : Boolean);
|
||||
constructor Create(entry : BEntry);
|
||||
destructor Destroy;override;
|
||||
function InitCheck : Status_t;
|
||||
function Exists : boolean;
|
||||
// function GetStat(st : stat) : Status_t;
|
||||
// function SetTo(dir : BDirectory; path : PChar; traverse : boolean) : Status_t;
|
||||
function SetTo(ref : EntryRef; traverse : boolean) : Status_t;
|
||||
function SetTo(path : PChar; traverse : boolean) : Status_t;
|
||||
destructor Destroy; override;
|
||||
function InitCheck : status_t;
|
||||
function Exists : Boolean;
|
||||
// function GetStat(st : stat) : status_t;
|
||||
// function SetTo(dir : BDirectory; path : PChar; traverse : boolean) : status_t;
|
||||
function SetTo(ref : entry_ref; traverse : Boolean) : status_t;
|
||||
function SetTo(path : PChar; traverse : Boolean) : status_t;
|
||||
procedure Unset;
|
||||
function GetRef(ref : EntryRef) : Status_t;
|
||||
// function GetPath(path : BPath) : Status_t;
|
||||
function GetParent(entry : BEntry) : Status_t;
|
||||
// function GetParent(dir : BDirectory) : Status_t;
|
||||
function GetName( var buffer : PChar) : Status_t;
|
||||
function Rename(path : PChar; clobber : boolean) : Status_t;
|
||||
// function MoveTo(dir : BDirectory; path : PChar; clobber : boolean) : Status_t;
|
||||
function Remove : Status_t;
|
||||
function GetRef(ref : entry_ref) : status_t;
|
||||
// function GetPath(path : BPath) : status_t;
|
||||
function GetParent(entry : BEntry) : status_t;
|
||||
// function GetParent(dir : BDirectory) : status_t;
|
||||
function GetName( var buffer : PChar) : status_t;
|
||||
function Rename(path : PChar; clobber : Boolean) : status_t;
|
||||
// function MoveTo(dir : BDirectory; path : PChar; clobber : boolean) : status_t;
|
||||
function Remove : status_t;
|
||||
end;
|
||||
|
||||
function BEntry_Create(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
//function BEntry_Create(AObject : TBeObject; dir : BDirectory; path : PChar; traverse : boolean); cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
function BEntry_Create(AObject : TBeObject; ref : EntryRef; traverse : boolean):TCPlusObject; cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
function BEntry_Create(AObject : TBeObject; path : PChar; traverse : boolean):TCPlusObject; cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
function BEntry_Create(AObject : TBeObject; entry : BEntry):TCPlusObject; cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
procedure BEntry_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BEntry_Free';
|
||||
function BEntry_InitCheck(AObject : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BEntry_InitCheck';
|
||||
function BEntry_Exists(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BEntry_Exists';
|
||||
//function BEntry_GetStat(AObject : TCPlusObject; st : stat) : Status_t; cdecl; external BePascalLibName name 'BEntry_GetStat';
|
||||
//function BEntry_SetTo(AObject : TCPlusObject; dir : BDirectory; path : PChar; traverse : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BEntry_SetTo';
|
||||
function BEntry_SetTo(AObject : TCPlusObject; ref : EntryRef; traverse : boolean) : Status_t; cdecl; external BePascalLibName name 'BEntry_SetTo';
|
||||
function BEntry_SetTo(AObject : TCPlusObject; path : PChar; traverse : boolean) : Status_t; cdecl; external BePascalLibName name 'BEntry_SetTo';
|
||||
procedure BEntry_Unset(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BEntry_Unset';
|
||||
function BEntry_GetRef(AObject : TCPlusObject; ref : EntryRef) : Status_t; cdecl; external BePascalLibName name 'BEntry_GetRef';
|
||||
//function BEntry_GetPath(AObject : TCPlusObject; path : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BEntry_GetPath';
|
||||
function BEntry_GetParent(AObject : TCPlusObject; entry : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BEntry_GetParent';
|
||||
//function BEntry_GetParent(AObject : TCPlusObject; dir : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BEntry_GetParent';
|
||||
function BEntry_GetName(AObject : TCPlusObject; buffer : PChar) : Status_t; cdecl; external BePascalLibName name 'BEntry_GetName';
|
||||
function BEntry_Rename(AObject : TCPlusObject; path : PChar; clobber : boolean) : Status_t; cdecl; external BePascalLibName name 'BEntry_Rename';
|
||||
function BEntry_MoveTo(AObject : TCPlusObject; dir : TCPlusObject; path : PChar; clobber : boolean) : Status_t; cdecl; external BePascalLibName name 'BEntry_MoveTo';
|
||||
function BEntry_Remove(AObject : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BEntry_Remove';
|
||||
function BEntry_Create(AObject : TBeObject) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
//function BEntry_Create(AObject : TBeObject; dir : BDirectory; path : PChar; traverse : Boolean); cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
function BEntry_Create(AObject : TBeObject; ref : entry_ref; traverse : Boolean) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
function BEntry_Create(AObject : TBeObject; path : PChar; traverse : Boolean) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
function BEntry_Create(AObject : TBeObject; entry : BEntry) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BEntry_Create';
|
||||
procedure BEntry_Free(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BEntry_Free';
|
||||
function BEntry_InitCheck(AObject : TCPlusObject) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_InitCheck';
|
||||
function BEntry_Exists(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BEntry_Exists';
|
||||
//function BEntry_GetStat(AObject : TCPlusObject; st : stat) : status_t; cdecl; external BePascalLibName name 'BEntry_GetStat';
|
||||
//function BEntry_SetTo(AObject : TCPlusObject; dir : BDirectory; path : PChar; traverse : Boolean) : status_t; cdecl; external BePascalLibName name 'BEntry_SetTo';
|
||||
function BEntry_SetTo(AObject : TCPlusObject; ref : entry_ref; traverse : Boolean) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_SetTo';
|
||||
function BEntry_SetTo(AObject : TCPlusObject; path : PChar; traverse : Boolean) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_SetTo';
|
||||
procedure BEntry_Unset(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BEntry_Unset';
|
||||
function BEntry_GetRef(AObject : TCPlusObject; ref : entry_ref) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_GetRef';
|
||||
//function BEntry_GetPath(AObject : TCPlusObject; path : TCPlusObject) : status_t; cdecl; external BePascalLibName name 'BEntry_GetPath';
|
||||
function BEntry_GetParent(AObject : TCPlusObject; entry : TCPlusObject) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_GetParent';
|
||||
//function BEntry_GetParent(AObject : TCPlusObject; dir : TCPlusObject) : status_t; cdecl; external BePascalLibName name 'BEntry_GetParent';
|
||||
function BEntry_GetName(AObject : TCPlusObject; buffer : PChar) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_GetName';
|
||||
function BEntry_Rename(AObject : TCPlusObject; path : PChar; clobber : Boolean) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_Rename';
|
||||
function BEntry_MoveTo(AObject : TCPlusObject; dir : TCPlusObject; path : PChar; clobber : Boolean) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_MoveTo';
|
||||
function BEntry_Remove(AObject : TCPlusObject) : status_t;
|
||||
cdecl; external BePascalLibName name 'BEntry_Remove';
|
||||
|
||||
implementation
|
||||
|
||||
@@ -93,18 +105,18 @@ begin
|
||||
CPlusObject := BEntry_Create(Self);
|
||||
end;
|
||||
|
||||
{constructor BEntry.Create(dir : BDirectory; path : PChar; traverse : boolean);
|
||||
{constructor BEntry.Create(dir : BDirectory; path : PChar; traverse : Boolean);
|
||||
begin
|
||||
CPlusObject := BEntry_Create(Self, dir, path, traverse);
|
||||
end;
|
||||
}
|
||||
constructor BEntry.Create(ref : EntryRef; traverse : boolean);
|
||||
constructor BEntry.Create(ref : entry_ref; traverse : Boolean);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BEntry_Create(Self, ref, traverse);
|
||||
end;
|
||||
|
||||
constructor BEntry.Create(path : PChar; traverse : boolean);
|
||||
constructor BEntry.Create(path : PChar; traverse : Boolean);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BEntry_Create(Self, path, traverse);
|
||||
@@ -127,27 +139,31 @@ begin
|
||||
Result := BEntry_InitCheck(CPlusObject);
|
||||
end;
|
||||
|
||||
function BEntry.Exists : boolean;
|
||||
function BEntry.Exists : Boolean;
|
||||
begin
|
||||
Result := BEntry_Exists(CPlusObject);
|
||||
end;
|
||||
|
||||
{function BEntry.GetStat(st : stat) : Status_t;
|
||||
{
|
||||
function BEntry.GetStat(st : stat) : status_t;
|
||||
begin
|
||||
Result := BEntry_GetStat(CPlusObject, st);
|
||||
end;
|
||||
}
|
||||
{function BEntry.SetTo(dir : BDirectory; path : PChar; traverse : boolean) : TStatus_t;
|
||||
|
||||
{
|
||||
function BEntry.SetTo(dir : BDirectory; path : PChar; traverse : Boolean) : status_t;
|
||||
begin
|
||||
Result := BEntry_SetTo(CPlusObject, dir, path, traverse);
|
||||
end;
|
||||
}
|
||||
function BEntry.SetTo(ref : EntryRef; traverse : boolean) : Status_t;
|
||||
|
||||
function BEntry.SetTo(ref : entry_ref; traverse : Boolean) : status_t;
|
||||
begin
|
||||
Result := BEntry_SetTo(CPlusObject, ref, traverse);
|
||||
end;
|
||||
|
||||
function BEntry.SetTo(path : PChar; traverse : boolean) : Status_t;
|
||||
function BEntry.SetTo(path : PChar; traverse : Boolean) : status_t;
|
||||
begin
|
||||
Result := BEntry_SetTo(CPlusObject, path, traverse);
|
||||
end;
|
||||
@@ -157,46 +173,50 @@ begin
|
||||
BEntry_Unset(CPlusObject);
|
||||
end;
|
||||
|
||||
function BEntry.GetRef(ref : EntryRef) : Status_t;
|
||||
function BEntry.GetRef(ref : entry_ref) : status_t;
|
||||
begin
|
||||
Result := BEntry_GetRef(CPlusObject, ref);
|
||||
end;
|
||||
|
||||
{function BEntry.GetPath(path : BPath) : Status_t;
|
||||
{
|
||||
function BEntry.GetPath(path : BPath) : status_t;
|
||||
begin
|
||||
Result := BEntry_GetPath(CPlusObject, path.CPlusObject);
|
||||
end;
|
||||
}
|
||||
function BEntry.GetParent(entry : BEntry) : Status_t;
|
||||
|
||||
function BEntry.GetParent(entry : BEntry) : status_t;
|
||||
begin
|
||||
Result := BEntry_GetParent(CPlusObject, entry.CPlusObject);
|
||||
end;
|
||||
|
||||
{function BEntry.GetParent(dir : BDirectory) : TStatus_t;
|
||||
{
|
||||
function BEntry.GetParent(dir : BDirectory) : status_t;
|
||||
begin
|
||||
Result := BEntry_GetParent(CPlusObject, dir.CPlusObject);
|
||||
end;
|
||||
}
|
||||
function BEntry.GetName(var buffer : PChar) : Status_t;
|
||||
|
||||
function BEntry.GetName(var buffer : PChar) : status_t;
|
||||
begin
|
||||
Result := BEntry_GetName(CPlusObject, buffer);
|
||||
end;
|
||||
|
||||
function BEntry.Rename(path : PChar; clobber : boolean) : Status_t;
|
||||
function BEntry.Rename(path : PChar; clobber : Boolean) : status_t;
|
||||
begin
|
||||
Result := BEntry_Rename(CPlusObject, path, clobber);
|
||||
end;
|
||||
|
||||
{function BEntry.MoveTo(dir : BDirectory; path : PChar; clobber : boolean) : TStatus_t;
|
||||
{
|
||||
function BEntry.MoveTo(dir : BDirectory; path : PChar; clobber : Boolean) : status_t;
|
||||
begin
|
||||
Result := BEntry_MoveTo(CPlusObject, dir.CPlusObject, path, clobber);
|
||||
end;
|
||||
}
|
||||
function BEntry.Remove : Status_t;
|
||||
|
||||
function BEntry.Remove : status_t;
|
||||
begin
|
||||
Result := BEntry_Remove(CPlusObject);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
end.
|
||||
@@ -1,128 +1,138 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit filepanel;
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002-2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit FilePanel;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj,classes,os,Entry,StorageDefs,message,messenger,window,supportdefs;
|
||||
BeObj, Classes, OS, Entry, StorageDefs, Message, Messenger, Window, SupportDefs;
|
||||
|
||||
type
|
||||
BRefFilter = class
|
||||
BRefFilter = class
|
||||
private
|
||||
public
|
||||
procedure Filter;
|
||||
end;
|
||||
|
||||
type
|
||||
file_panel_mode =(
|
||||
B_OPEN_PANEL,
|
||||
B_SAVE_PANEL
|
||||
);
|
||||
|
||||
type
|
||||
file_panel_button =(
|
||||
B_CANCEL_BUTTON,
|
||||
B_DEFAULT_BUTTON
|
||||
);
|
||||
|
||||
type
|
||||
BFilePanel = class(TBeObject)
|
||||
private
|
||||
file_panel_mode = (
|
||||
B_OPEN_PANEL,
|
||||
B_SAVE_PANEL
|
||||
);
|
||||
|
||||
file_panel_button = (
|
||||
B_CANCEL_BUTTON,
|
||||
B_DEFAULT_BUTTON
|
||||
);
|
||||
|
||||
BFilePanel = class(TBeObject)
|
||||
public
|
||||
constructor Create( mode :file_panel_mode;
|
||||
target : BMessenger;
|
||||
const start_directory : entryref;
|
||||
node_flavors : integer;
|
||||
allow_multiple_selection : boolean;
|
||||
message : BMessage ;
|
||||
filter : BRefFilter;
|
||||
modal ,
|
||||
hide_when_done : boolean);
|
||||
constructor Create(mode : file_panel_mode; target : BMessenger;
|
||||
const start_directory : entryref; node_flavors : integer;
|
||||
allow_multiple_selection : Boolean; message : BMessage;
|
||||
filter : BRefFilter; modal, hide_when_done : Boolean);
|
||||
destructor Destroy; override;
|
||||
procedure Show;
|
||||
procedure Hide;
|
||||
function IsShowing : boolean;
|
||||
function IsShowing : Boolean;
|
||||
procedure WasHidden;
|
||||
procedure SelectionChanged;
|
||||
procedure SendMessage( Messager: BMessenger ; Message : BMessage);
|
||||
procedure SendMessage(Messager: BMessenger; Message : BMessage);
|
||||
function Window : BWindow;
|
||||
function Messenger : BMessenger;
|
||||
function RefFilter : BRefFilter;
|
||||
procedure GetPanelDirectory( entry: EntryRef);
|
||||
procedure GetPanelDirectory(entry: entry_ref);
|
||||
function PanelMode : file_panel_mode;
|
||||
procedure SetTarget( Mess: BMessenger);
|
||||
procedure SetTarget(Mess: BMessenger);
|
||||
procedure SetMessage(msg : BMessage);
|
||||
procedure SetRefFilter(filter : BRefFilter);
|
||||
procedure SetSaveText(text : PChar);
|
||||
procedure SetButtonLabel( button: file_panel_button; alabel : PChar);
|
||||
{ procedure SetPanelDirectory(new_directory : );
|
||||
procedure SetButtonLabel(button : file_panel_button; alabel : PChar);
|
||||
{
|
||||
procedure SetPanelDirectory(new_directory : );
|
||||
procedure SetPanelDirectory(new_directory : );
|
||||
}
|
||||
procedure SetPanelDirectory(new_directory : EntryRef);
|
||||
procedure SetPanelDirectory(new_directory : entry_ref);
|
||||
procedure SetPanelDirectory(new_directory : PChar);
|
||||
|
||||
procedure SetHideWhenDone( ahide: boolean);
|
||||
function HidesWhenDone : boolean;
|
||||
procedure SetHideWhenDone(ahide: Boolean);
|
||||
function HidesWhenDone : Boolean;
|
||||
procedure Refresh;
|
||||
procedure Rewind;
|
||||
function GetNextSelectedRef(var ref : EntryRef) : Status_t;
|
||||
function GetNextSelectedRef(var ref : entry_ref) : status_t;
|
||||
end;
|
||||
|
||||
procedure BRefFilter_Filter(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRefFilter_Filter';
|
||||
function BFilePanel_Create(AObject : TBeObject;
|
||||
mode :file_panel_mode;
|
||||
target : BMessenger;
|
||||
const start_directory : entryref;
|
||||
node_flavors : integer;
|
||||
allow_multiple_selection : boolean;
|
||||
message : BMessage ;
|
||||
filter : BRefFilter;
|
||||
modal ,
|
||||
hide_when_done : boolean) : TCPlusObject; cdecl; external BePascalLibName name 'BFilePanel_Create';
|
||||
|
||||
procedure BRefFilter_Filter(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BRefFilter_Filter';
|
||||
function BFilePanel_Create(AObject : TBeObject; mode : file_panel_mode; target : BMessenger;
|
||||
const start_directory : entryref; node_flavors : integer;
|
||||
allow_multiple_selection : Boolean; message : BMessage;
|
||||
filter : BRefFilter; modal, hide_when_done : Boolean)
|
||||
: TCPlusObject; cdecl; external BePascalLibName name 'BFilePanel_Create';
|
||||
|
||||
procedure BFilePanel_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Free';
|
||||
procedure BFilePanel_Show(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Show';
|
||||
procedure BFilePanel_Hide(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Hide';
|
||||
function BFilePanel_IsShowing(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFilePanel_IsShowing';
|
||||
procedure BFilePanel_WasHidden(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_WasHidden';
|
||||
procedure BFilePanel_SelectionChanged(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SelectionChanged';
|
||||
procedure BFilePanel_SendMessage(AObject : TCPlusObject; mess :TCPlusObject ; message : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SendMessage';
|
||||
function BFilePanel_Window(AObject : TCPlusObject) : BWindow; cdecl; external BePascalLibName name 'BFilePanel_Window';
|
||||
|
||||
function BFilePanel_IsShowing(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BFilePanel_IsShowing';
|
||||
procedure BFilePanel_WasHidden(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_WasHidden';
|
||||
procedure BFilePanel_SelectionChanged(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SelectionChanged';
|
||||
procedure BFilePanel_SendMessage(AObject : TCPlusObject; mess : TCPlusObject; message : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SendMessage';
|
||||
function BFilePanel_Window(AObject : TCPlusObject) : BWindow;
|
||||
cdecl; external BePascalLibName name 'BFilePanel_Window';
|
||||
//function BFilePanel_Messenger(AObject : TCPlusObject) : BMessenger; cdecl; external BePascalLibName name 'BFilePanel_Messenger';
|
||||
function BFilePanel_RefFilter(AObject : TCPlusObject) : BRefFilter; cdecl; external BePascalLibName name 'BFilePanel_RefFilter';
|
||||
procedure BFilePanel_GetPanelDirectory(AObject : TCPlusObject; entry: EntryRef); cdecl; external BePascalLibName name 'BFilePanel_GetPanelDirectory';
|
||||
function BFilePanel_PanelMode(AObject : TCPlusObject) : BRefFilter; cdecl; external BePascalLibName name 'BFilePanel_PanelMode';
|
||||
function BFilePanel_RefFilter(AObject : TCPlusObject) : BRefFilter;
|
||||
cdecl; external BePascalLibName name 'BFilePanel_RefFilter';
|
||||
procedure BFilePanel_GetPanelDirectory(AObject : TCPlusObject; entry : entry_ref);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_GetPanelDirectory';
|
||||
function BFilePanel_PanelMode(AObject : TCPlusObject) : BRefFilter;
|
||||
cdecl; external BePascalLibName name 'BFilePanel_PanelMode';
|
||||
//procedure BFilePanel_SetTarget(AObject : TCPlusObject; Mess : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SetTarget';
|
||||
procedure BFilePanel_SetMessage(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SetMessage';
|
||||
procedure BFilePanel_SetRefFilter(AObject : TCPlusObject; filter : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_SetRefFilter';
|
||||
procedure BFilePanel_SetSaveText(AObject : TCPlusObject; text : PChar); cdecl; external BePascalLibName name 'BFilePanel_SetSaveText';
|
||||
procedure BFilePanel_SetButtonLabel(AObject : TCPlusObject; button: file_panel_button; alabel : PChar); cdecl; external BePascalLibName name 'BFilePanel_SetButtonLabel';
|
||||
{procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : ); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory';
|
||||
procedure BFilePanel_SetMessage(AObject : TCPlusObject; msg : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SetMessage';
|
||||
procedure BFilePanel_SetRefFilter(AObject : TCPlusObject; filter : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SetRefFilter';
|
||||
procedure BFilePanel_SetSaveText(AObject : TCPlusObject; text : PChar);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SetSaveText';
|
||||
procedure BFilePanel_SetButtonLabel(AObject : TCPlusObject; button : file_panel_button; alabel : PChar);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SetButtonLabel';
|
||||
{
|
||||
procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : ); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory';
|
||||
}procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : EntryRef); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory';
|
||||
procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : PChar); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory';
|
||||
procedure BFilePanel_SetHideWhenDone(AObject : TCPlusObject; hiden: boolean); cdecl; external BePascalLibName name 'BFilePanel_SetHideWhenDone';
|
||||
function BFilePanel_HidesWhenDone(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFilePanel_HidesWhenDone';
|
||||
procedure BFilePanel_Refresh(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Refresh';
|
||||
procedure BFilePanel_Rewind(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFilePanel_Rewind';
|
||||
function BFilePanel_GetNextSelectedRef(AObject : TCPlusObject; var entry : EntryRef) : Status_t; cdecl; external BePascalLibName name 'BFilePanel_GetNextSelectedRef';
|
||||
procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : ); cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory';
|
||||
}
|
||||
procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : entry_ref);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory';
|
||||
procedure BFilePanel_SetPanelDirectory(AObject : TCPlusObject; new_directory : PChar);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SetPanelDirectory';
|
||||
procedure BFilePanel_SetHideWhenDone(AObject : TCPlusObject; hiden: Boolean);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_SetHideWhenDone';
|
||||
function BFilePanel_HidesWhenDone(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BFilePanel_HidesWhenDone';
|
||||
procedure BFilePanel_Refresh(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_Refresh';
|
||||
procedure BFilePanel_Rewind(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BFilePanel_Rewind';
|
||||
function BFilePanel_GetNextSelectedRef(AObject : TCPlusObject; var entry : entry_ref) : status_t;
|
||||
cdecl; external BePascalLibName name 'BFilePanel_GetNextSelectedRef';
|
||||
|
||||
implementation
|
||||
|
||||
@@ -131,18 +141,16 @@ begin
|
||||
// BRefFilter_Filter(CPlusObject);
|
||||
end;
|
||||
|
||||
constructor BFilePanel.Create( mode :file_panel_mode;
|
||||
target : BMessenger;
|
||||
const start_directory : entryref;
|
||||
node_flavors : integer;
|
||||
allow_multiple_selection : boolean;
|
||||
message : BMessage ;
|
||||
filter : BRefFilter;
|
||||
modal : boolean;
|
||||
hide_when_done : boolean);
|
||||
constructor BFilePanel.Create(mode : file_panel_mode; target : BMessenger;
|
||||
const start_directory : entry_ref; node_flavors : integer;
|
||||
allow_multiple_selection : Boolean; message : BMessage;
|
||||
filter : BRefFilter; modal : Boolean;
|
||||
hide_when_done : Boolean);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BFilePanel_Create(Self,mode,target,start_directory,node_flavors,allow_multiple_selection,message,filter,modal,hide_when_done);
|
||||
CPlusObject := BFilePanel_Create(Self, mode, target, start_directory,
|
||||
node_flavors, allow_multiple_selection,
|
||||
message, filter, modal, hide_when_done);
|
||||
end;
|
||||
|
||||
destructor BFilePanel.Destroy;
|
||||
@@ -161,7 +169,7 @@ begin
|
||||
BFilePanel_Hide(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFilePanel.IsShowing : boolean;
|
||||
function BFilePanel.IsShowing : Boolean;
|
||||
begin
|
||||
Result := BFilePanel_IsShowing(CPlusObject);
|
||||
end;
|
||||
@@ -176,9 +184,9 @@ begin
|
||||
BFilePanel_SelectionChanged(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFilePanel.SendMessage( Messager: BMessenger ; Message : BMessage);
|
||||
procedure BFilePanel.SendMessage(Messager : BMessenger; Message : BMessage);
|
||||
begin
|
||||
BFilePanel_SendMessage(CPlusObject,Messager , Message.CPlusObject);
|
||||
BFilePanel_SendMessage(CPlusObject, Messager, Message.CPlusObject);
|
||||
end;
|
||||
|
||||
function BFilePanel.Window : BWindow;
|
||||
@@ -196,12 +204,12 @@ begin
|
||||
Result := BFilePanel_RefFilter(CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BFilePanel.GetPanelDirectory(entry : EntryRef);
|
||||
procedure BFilePanel.GetPanelDirectory(entry : entry_ref);
|
||||
begin
|
||||
BFilePanel_GetPanelDirectory(CPlusObject, entry);
|
||||
end;
|
||||
|
||||
function BFilePanel.PanelMode :file_panel_mode ;
|
||||
function BFilePanel.PanelMode : file_panel_mode;
|
||||
begin
|
||||
// Result := BFilePanel_PanelMode(CPlusObject);
|
||||
end;
|
||||
@@ -226,12 +234,13 @@ begin
|
||||
BFilePanel_SetSaveText(CPlusObject, text);
|
||||
end;
|
||||
|
||||
procedure BFilePanel.SetButtonLabel( button: file_panel_button; alabel : PChar);
|
||||
procedure BFilePanel.SetButtonLabel(button : file_panel_button; alabel : PChar);
|
||||
begin
|
||||
BFilePanel_SetButtonLabel(CPlusObject,button , alabel);
|
||||
BFilePanel_SetButtonLabel(CPlusObject, button, alabel);
|
||||
end;
|
||||
|
||||
{procedure BFilePanel.SetPanelDirectory(new_directory : );
|
||||
{
|
||||
procedure BFilePanel.SetPanelDirectory(new_directory : );
|
||||
begin
|
||||
BFilePanel_SetPanelDirectory(CPlusObject, new_directory);
|
||||
end;
|
||||
@@ -241,7 +250,8 @@ begin
|
||||
BFilePanel_SetPanelDirectory(CPlusObject, new_directory);
|
||||
end;
|
||||
}
|
||||
procedure BFilePanel.SetPanelDirectory(new_directory :EntryRef);
|
||||
|
||||
procedure BFilePanel.SetPanelDirectory(new_directory : entry_ref);
|
||||
begin
|
||||
BFilePanel_SetPanelDirectory(CPlusObject, new_directory);
|
||||
end;
|
||||
@@ -251,12 +261,12 @@ begin
|
||||
BFilePanel_SetPanelDirectory(CPlusObject, new_directory);
|
||||
end;
|
||||
|
||||
procedure BFilePanel.SetHideWhenDone( ahide: boolean);
|
||||
procedure BFilePanel.SetHideWhenDone(ahide : Boolean);
|
||||
begin
|
||||
BFilePanel_SetHideWhenDone(CPlusObject, ahide);
|
||||
end;
|
||||
|
||||
function BFilePanel.HidesWhenDone : boolean;
|
||||
function BFilePanel.HidesWhenDone : Boolean;
|
||||
begin
|
||||
Result := BFilePanel_HidesWhenDone(CPlusObject);
|
||||
end;
|
||||
@@ -271,11 +281,9 @@ begin
|
||||
BFilePanel_Rewind(CPlusObject);
|
||||
end;
|
||||
|
||||
function BFilePanel.GetNextSelectedRef(var ref: EntryRef) : Status_t;
|
||||
function BFilePanel.GetNextSelectedRef(var ref : entry_ref) : status_t;
|
||||
begin
|
||||
Result := BFilePanel_GetNextSelectedRef(CPlusObject, ref);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
||||
96
bepascal/source/bepascal/pas/src/be/storage/finddirectory.pp
Normal file
96
bepascal/source/bepascal/pas/src/be/storage/finddirectory.pp
Normal file
@@ -0,0 +1,96 @@
|
||||
unit FindDirectory;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Path, SupportDefs, Volume;
|
||||
|
||||
const
|
||||
{
|
||||
Per volume directories. When asking for these
|
||||
directories, a volume must be specified, or the call will assume
|
||||
the boot volume.
|
||||
}
|
||||
B_DESKTOP_DIRECTORY = 0;
|
||||
B_TRASH_DIRECTORY = B_DESKTOP_DIRECTORY + 1;
|
||||
|
||||
// BeOS directories. These are mostly accessed read-only.
|
||||
B_BEOS_DIRECTORY = 1000;
|
||||
B_BEOS_SYSTEM_DIRECTORY = B_BEOS_DIRECTORY + 1;
|
||||
B_BEOS_ADDONS_DIRECTORY = B_BEOS_DIRECTORY + 2;
|
||||
B_BEOS_BOOT_DIRECTORY = B_BEOS_DIRECTORY + 3;
|
||||
B_BEOS_FONTS_DIRECTORY = B_BEOS_DIRECTORY + 4;
|
||||
B_BEOS_LIB_DIRECTORY = B_BEOS_DIRECTORY + 5;
|
||||
B_BEOS_SERVERS_DIRECTORY = B_BEOS_DIRECTORY + 6;
|
||||
B_BEOS_APPS_DIRECTORY = B_BEOS_DIRECTORY + 7;
|
||||
B_BEOS_BIN_DIRECTORY = B_BEOS_DIRECTORY + 8;
|
||||
B_BEOS_ETC_DIRECTORY = B_BEOS_DIRECTORY + 9;
|
||||
B_BEOS_DOCUMENTATION_DIRECTORY = B_BEOS_DIRECTORY + 10;
|
||||
B_BEOS_PREFERENCES_DIRECTORY = B_BEOS_DIRECTORY + 11;
|
||||
B_BEOS_TRANSLATORS_DIRECTORY = B_BEOS_DIRECTORY + 12;
|
||||
B_BEOS_MEDIA_NODES_DIRECTORY = B_BEOS_DIRECTORY + 13;
|
||||
B_BEOS_SOUNDS_DIRECTORY = B_BEOS_DIRECTORY + 14;
|
||||
|
||||
// Common directories, shared among all users.
|
||||
B_COMMON_DIRECTORY = 2000;
|
||||
B_COMMON_SYSTEM_DIRECTORY = B_COMMON_DIRECTORY + 1;
|
||||
B_COMMON_ADDONS_DIRECTORY = B_COMMON_DIRECTORY + 2;
|
||||
B_COMMON_BOOT_DIRECTORY = B_COMMON_DIRECTORY + 3;
|
||||
B_COMMON_FONTS_DIRECTORY = B_COMMON_DIRECTORY + 4;
|
||||
B_COMMON_LIB_DIRECTORY = B_COMMON_DIRECTORY + 5;
|
||||
B_COMMON_SERVERS_DIRECTORY = B_COMMON_DIRECTORY + 6;
|
||||
B_COMMON_BIN_DIRECTORY = B_COMMON_DIRECTORY + 7;
|
||||
B_COMMON_ETC_DIRECTORY = B_COMMON_DIRECTORY + 8;
|
||||
B_COMMON_DOCUMENTATION_DIRECTORY = B_COMMON_DIRECTORY + 9;
|
||||
B_COMMON_SETTINGS_DIRECTORY = B_COMMON_DIRECTORY + 10;
|
||||
B_COMMON_DEVELOP_DIRECTORY = B_COMMON_DIRECTORY + 11;
|
||||
B_COMMON_LOG_DIRECTORY = B_COMMON_DIRECTORY + 12;
|
||||
B_COMMON_SPOOL_DIRECTORY = B_COMMON_DIRECTORY + 13;
|
||||
B_COMMON_TEMP_DIRECTORY = B_COMMON_DIRECTORY + 14;
|
||||
B_COMMON_VAR_DIRECTORY = B_COMMON_DIRECTORY + 15;
|
||||
B_COMMON_TRANSLATORS_DIRECTORY = B_COMMON_DIRECTORY + 16;
|
||||
B_COMMON_MEDIA_NODES_DIRECTORY = B_COMMON_DIRECTORY + 17;
|
||||
B_COMMON_SOUNDS_DIRECTORY = B_COMMON_DIRECTORY + 18;
|
||||
|
||||
{
|
||||
User directories. These are interpreted in the context
|
||||
of the user making the find_directory call.
|
||||
}
|
||||
B_USER_DIRECTORY = 3000;
|
||||
B_USER_CONFIG_DIRECTORY = B_USER_DIRECTORY + 1;
|
||||
B_USER_ADDONS_DIRECTORY = B_USER_DIRECTORY + 2;
|
||||
B_USER_BOOT_DIRECTORY = B_USER_DIRECTORY + 3;
|
||||
B_USER_FONTS_DIRECTORY = B_USER_DIRECTORY + 4;
|
||||
B_USER_LIB_DIRECTORY = B_USER_DIRECTORY + 5;
|
||||
B_USER_SETTINGS_DIRECTORY = B_USER_DIRECTORY + 6;
|
||||
B_USER_DESKBAR_DIRECTORY = B_USER_DIRECTORY + 7;
|
||||
B_USER_PRINTERS_DIRECTORY = B_USER_DIRECTORY + 8;
|
||||
B_USER_TRANSLATORS_DIRECTORY = B_USER_DIRECTORY + 9;
|
||||
B_USER_MEDIA_NODES_DIRECTORY = B_USER_DIRECTORY + 10;
|
||||
B_USER_SOUNDS_DIRECTORY = B_USER_DIRECTORY + 11;
|
||||
|
||||
// Global directories.
|
||||
B_APPS_DIRECTORY = 4000;
|
||||
B_PREFERENCES_DIRECTORY = B_APPS_DIRECTORY + 1;
|
||||
B_UTILITIES_DIRECTORY = B_APPS_DIRECTORY + 2;
|
||||
|
||||
type
|
||||
directory_which = Longword; // to replace the enum
|
||||
|
||||
// The C interface
|
||||
function find_directory(which : directory_which; // what directory to return path for
|
||||
device : dev_t; // device w/volume, for vol-specific directories
|
||||
create_it : Boolean; // create directory if need be
|
||||
returned_path : PChar; // buffer for returned path
|
||||
path_length : Longint) // buffer size
|
||||
: status_t; cdecl; external 'root' name 'find_directory';
|
||||
|
||||
// C++ interface
|
||||
function find_directory(which : directory_which; var path : BPath;
|
||||
and_create_it : Boolean {$ifndef VER1_0}= false{$endif};
|
||||
var vol : BVolume {$ifndef VER1_0}= nil{$endif})
|
||||
: status_t; cdecl; external 'be' name 'find_directory';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
146
bepascal/source/bepascal/pas/src/be/storage/mime.pp
Normal file
146
bepascal/source/bepascal/pas/src/be/storage/mime.pp
Normal file
@@ -0,0 +1,146 @@
|
||||
unit Mime;
|
||||
// Description: MIME string functions
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
// types,
|
||||
BeObj, Bitmap, Entry, Message, Messenger, SupportDefs, StorageDefs, BString;
|
||||
|
||||
function update_mime_info(const path : PChar; recursive : Integer;
|
||||
synchronous : Integer; force : Integer) : Integer;
|
||||
cdecl; external 'be' name 'update_mime_info';
|
||||
function create_app_meta_mime(const path: PChar; recursive : Integer;
|
||||
synchronous : Integer; force : Integer) : status_t;
|
||||
cdecl; external 'be' name 'create_app_meta_mime';
|
||||
function get_device_icon(const dev : PChar; var icon : Pointer; size : Longint) : status_t;
|
||||
cdecl; external 'be' name 'get_device_icon';
|
||||
|
||||
const
|
||||
_B_MIME_STRING_TYPE = 'MIMS';
|
||||
var
|
||||
B_MIME_STRING_TYPE : Longword;
|
||||
|
||||
// these replace: enum icon_size {B_LARGE_ICON = 32, B_MINI_ICON = 16}
|
||||
type
|
||||
icon_size = Integer;
|
||||
|
||||
const
|
||||
B_LARGE_ICON = 32;
|
||||
B_MINI_ICON = 16;
|
||||
|
||||
{
|
||||
class BBitmap;
|
||||
class BResources;
|
||||
class BAppFileInfo;
|
||||
class BMessenger;
|
||||
}
|
||||
|
||||
type
|
||||
app_verb = (B_OPEN);
|
||||
|
||||
var
|
||||
B_APP_MIME_TYPE : PChar; cvar; external; // platform dependent
|
||||
B_PEF_APP_MIME_TYPE : PChar; cvar; external; // "application/x-be-executable"
|
||||
B_PE_APP_MIME_TYPE : PChar; cvar; external; // "application/x-vnd.be-peexecutable"
|
||||
B_ELF_APP_MIME_TYPE : PChar; cvar; external; // "application/x-vnd.be-elfexecutable"
|
||||
B_RESOURCE_MIME_TYPE : PChar; cvar; external; // "application/x-be-resource"
|
||||
B_FILE_MIME_TYPE : PChar; cvar; external; // "application/octet-stream"
|
||||
|
||||
// -------------------------------------------------------------
|
||||
const
|
||||
B_META_MIME_CHANGED = 'MMCH';
|
||||
|
||||
B_ICON_CHANGED = $00000001;
|
||||
B_PREFERRED_APP_CHANGED = $00000002;
|
||||
B_ATTR_INFO_CHANGED = $00000004;
|
||||
B_FILE_EXTENSIONS_CHANGED = $00000008;
|
||||
B_SHORT_DESCRIPTION_CHANGED = $00000010;
|
||||
B_LONG_DESCRIPTION_CHANGED = $00000020;
|
||||
B_ICON_FOR_TYPE_CHANGED = $00000040;
|
||||
B_APP_HINT_CHANGED = $00000080;
|
||||
B_MIME_TYPE_CREATED = $00000100;
|
||||
B_MIME_TYPE_DELETED = $00000200;
|
||||
B_SNIFFER_RULE_CHANGED = $00000400;
|
||||
|
||||
B_EVERYTHING_CHANGED : Integer = $FFFFFFFF;
|
||||
|
||||
// -------------------------------------------------------------
|
||||
type
|
||||
BMimeType = class(TBeObject)
|
||||
public
|
||||
constructor Create;
|
||||
constructor Create(const MIME_type : PChar);
|
||||
destructor Destroy; override;
|
||||
|
||||
function SetTo(const MIME_type : PChar) : status_t;
|
||||
procedure Unset;
|
||||
function InitCheck : status_t;
|
||||
|
||||
// these functions simply perform string manipulations
|
||||
_Type : PChar;
|
||||
function IsValid : Boolean;
|
||||
function IsSupertypeOnly : Boolean;
|
||||
function IsInstalled : Boolean;
|
||||
function GetSupertype(var super_type : BMimeType) : status_t;
|
||||
|
||||
// Sadly, we don't have Class operators :-(
|
||||
// bool operator==(const BMimeType &type) : Boolean;
|
||||
// bool operator==(const char *type) : Boolean;
|
||||
|
||||
function Contains(const type_ : BMimeType) : Boolean;
|
||||
|
||||
// These functions are for managing data in the meta mime file
|
||||
function Install : status_t;
|
||||
function Delete : status_t;
|
||||
function GetIcon(var icon : BBitmap; wich : icon_size) : status_t;
|
||||
function GetPreferredApp(var signature : PChar; verb : app_verb {$ifndef VER1_0}= B_OPEN{$endif}) : status_t;
|
||||
function GetAttrInfo(var info : BMessage) : status_t;
|
||||
function GetFileExtensions(var extensions : BMessage) : status_t;
|
||||
function GetShortDescription(var description : PChar) : status_t;
|
||||
function GetLongDescription(var description : PChar) : status_t;
|
||||
function GetSupportingApps(var signatures : BMessage) : status_t;
|
||||
|
||||
function SetIcon(const icon : BBitmap; wich : icon_size) : status_t;
|
||||
function SetPreferredApp(const signature : PChar;
|
||||
verb : app_verb {$ifndef VER1_0}= B_OPEN{$endif}) : status_t;
|
||||
function SetAttrInfo(const info : BMessage) : status_t;
|
||||
function SetFileExtensions(const extensions : BMessage) : status_t;
|
||||
function SetShortDescription(const description : PChar) : status_t;
|
||||
function SetLongDescription(const description : PChar) : status_t;
|
||||
|
||||
function GetInstalledSupertypes(var super_types : BMessage) : status_t;
|
||||
function GetInstalledTypes(var types : BMessage) : status_t;
|
||||
function GetInstalledTypes(const super_type : PChar; var subtypes : BMessage) : status_t;
|
||||
function GetWildcardApps(wild_ones : BMessage) : status_t;
|
||||
function IsValid(const _string : PChar) : Boolean;
|
||||
|
||||
function GetAppHint(var ref : entry_ref) : status_t;
|
||||
function SetAppHint(const ref : entry_ref) : status_t;
|
||||
|
||||
// for application signatures only.
|
||||
function GetIconForType(const type_ : PChar; var icon : BBitmap; which : icon_size) : status_t;
|
||||
function SetIconForType(const type_ : PChar; const icon : BBitmap; which : icon_size) : status_t;
|
||||
|
||||
// sniffer rule manipulation
|
||||
function GetSnifferRule(var result : BString) : status_t;
|
||||
function SetSnifferRule(const rule : PChar) : status_t;
|
||||
function CheckSnifferRule(const rule : PChar; var parseError : BString) : status_t;
|
||||
|
||||
// calls to ask the sniffer to identify the MIME type of a file or data in memory
|
||||
function GuessMimeType(const _file : entry_ref; var result : BMimeType) : status_t;
|
||||
function GuessMimeType(const buffer : Pointer; length : Longint; var result : BMimeType) : status_t;
|
||||
function GuessMimeType(const filename : PChar; var result : BMimeType) : status_t;
|
||||
|
||||
function StartWatching(target : BMessenger) : status_t;
|
||||
function StopWatching(target : BMessenger) : status_t;
|
||||
|
||||
// Deprecated Use SetTo instead.
|
||||
function SetType(const MIME_type : PChar) : status_t;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
B_MIME_STRING_TYPE := _B_MIME_STRING_TYPE;
|
||||
end.
|
||||
@@ -1,68 +1,85 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Olivier Coursiere
|
||||
Eric Jourde
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit path;
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 - 2003 Olivier Coursiere
|
||||
Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
unit Path;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj,classes,entry,storagedefs,SupportDefs;
|
||||
BeObj, Classes, Entry, StorageDefs, SupportDefs;
|
||||
|
||||
type
|
||||
BPath = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create;
|
||||
constructor Create(dir : PChar; aleaf : PChar; normalize : boolean);
|
||||
// constructor Create(dir : BDirectory; leaf : PChar; normalize : boolean);
|
||||
constructor Create(dir : PChar; aLeaf : PChar; normalize : Boolean);
|
||||
// constructor Create(dir : BDirectory; leaf : PChar; normalize : Boolean);
|
||||
constructor Create(apath : BPath);
|
||||
constructor Create(entry : BEntry);
|
||||
constructor Create_1(ref : EntryRef);
|
||||
constructor Create_1(ref : entry_ref);
|
||||
destructor Destroy; override;
|
||||
function InitCheck : Status_t;
|
||||
function SetTo(apath : PChar; aleaf : PChar; normalize : boolean) : Status_t;
|
||||
// function SetTo(dir : BDirectory; path : PChar; normalize : boolean) : Status_t;
|
||||
function SetTo(entry : BEntry) : Status_t;
|
||||
function SetTo_1(ref : PEntryRef) : Status_t;
|
||||
function Append(apath : PChar; normalize : boolean) : Status_t;
|
||||
function InitCheck : status_t;
|
||||
function SetTo(apath : PChar; aleaf : PChar; normalize : Boolean) : status_t;
|
||||
// function SetTo(dir : BDirectory; path : PChar; normalize : Boolean) : status_t;
|
||||
function SetTo(entry : BEntry) : status_t;
|
||||
function SetTo_1(ref : PEntry_ref) : status_t;
|
||||
function Append(aPath : PChar; normalize : Boolean) : status_t;
|
||||
procedure Unset;
|
||||
function Path : PChar;
|
||||
function Leaf : PChar;
|
||||
function GetParent(aPath: BPath) : Status_t;
|
||||
function GetParent(aPath: BPath) : status_t;
|
||||
end;
|
||||
|
||||
function BPath_Create(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create';
|
||||
function BPath_Create(AObject : TBeObject; dir : PChar; leaf : PChar; normalize : boolean):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create';
|
||||
//function BPath_Create(AObject : TBeObject; dir : BDirectory; leaf : PChar; normalize : boolean):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create';
|
||||
function BPath_Create(AObject : TBeObject; path : BPath):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create';
|
||||
function BPath_Create(AObject : TBeObject; entry : BEntry):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create';
|
||||
function BPath_Create(AObject : TBeObject; ref : EntryRef):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create';
|
||||
procedure BPath_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPath_Free';
|
||||
function BPath_InitCheck(AObject : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BPath_InitCheck';
|
||||
function BPath_SetTo(AObject : TCPlusObject; path : PChar; leaf : PChar; normalize : boolean) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo';
|
||||
//function BPath_SetTo(AObject : TCPlusObject; dir : BDirectory; path : PChar; normalize : boolean) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo';
|
||||
function BPath_SetTo(AObject : TCPlusObject; entry : BEntry) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo';
|
||||
function BPath_SetTo_3(AObject : TCPlusObject; ref : PEntryRef) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo_3';
|
||||
function BPath_Append(AObject : TCPlusObject; path : PChar; normalize : boolean) : Status_t; cdecl; external BePascalLibName name 'BPath_Append';
|
||||
procedure BPath_Unset(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BPath_Unset';
|
||||
function BPath_Path(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BPath_Path';
|
||||
function BPath_Leaf(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BPath_Leaf';
|
||||
function BPath_GetParent(AObject : TCPlusObject; aPath : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BPath_GetParent';
|
||||
function BPath_Create(AObject : TBeObject) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BPath_Create';
|
||||
function BPath_Create(AObject : TBeObject; dir : PChar; leaf : PChar;
|
||||
normalize : Boolean) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BPath_Create';
|
||||
//function BPath_Create(AObject : TBeObject; dir : BDirectory; leaf : PChar; normalize : Boolean):TCPlusObject; cdecl; external BePascalLibName name 'BPath_Create';
|
||||
function BPath_Create(AObject : TBeObject; path : BPath) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BPath_Create';
|
||||
function BPath_Create(AObject : TBeObject; entry : BEntry) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BPath_Create';
|
||||
function BPath_Create(AObject : TBeObject; ref : entry_ref) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BPath_Create';
|
||||
procedure BPath_Free(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BPath_Free';
|
||||
function BPath_InitCheck(AObject : TCPlusObject) : status_t;
|
||||
cdecl; external BePascalLibName name 'BPath_InitCheck';
|
||||
function BPath_SetTo(AObject : TCPlusObject; path : PChar; leaf : PChar;
|
||||
normalize : Boolean) : status_t;
|
||||
cdecl; external BePascalLibName name 'BPath_SetTo';
|
||||
//function BPath_SetTo(AObject : TCPlusObject; dir : BDirectory; path : PChar; normalize : Boolean) : Status_t; cdecl; external BePascalLibName name 'BPath_SetTo';
|
||||
function BPath_SetTo(AObject : TCPlusObject; entry : BEntry) : status_t;
|
||||
cdecl; external BePascalLibName name 'BPath_SetTo';
|
||||
function BPath_SetTo_3(AObject : TCPlusObject; ref : PEntry_ref) : status_t;
|
||||
cdecl; external BePascalLibName name 'BPath_SetTo_3';
|
||||
function BPath_Append(AObject : TCPlusObject; path : PChar; normalize : Boolean) : status_t;
|
||||
cdecl; external BePascalLibName name 'BPath_Append';
|
||||
procedure BPath_Unset(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BPath_Unset';
|
||||
function BPath_Path(AObject : TCPlusObject) : PChar;
|
||||
cdecl; external BePascalLibName name 'BPath_Path';
|
||||
function BPath_Leaf(AObject : TCPlusObject) : PChar;
|
||||
cdecl; external BePascalLibName name 'BPath_Leaf';
|
||||
function BPath_GetParent(AObject : TCPlusObject; aPath : TCPlusObject) : status_t;
|
||||
cdecl; external BePascalLibName name 'BPath_GetParent';
|
||||
|
||||
implementation
|
||||
|
||||
@@ -72,22 +89,24 @@ begin
|
||||
CPlusObject := BPath_Create(Self);
|
||||
end;
|
||||
|
||||
constructor BPath.Create(dir : PChar; aleaf : PChar; normalize : boolean);
|
||||
constructor BPath.Create(dir : PChar; aLeaf : PChar; normalize : Boolean);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BPath_Create(Self, dir, aleaf, normalize);
|
||||
CPlusObject := BPath_Create(Self, dir, aLeaf, normalize);
|
||||
end;
|
||||
|
||||
{constructor BPath.Create(dir : BDirectory; aleaf : PChar; normalize : boolean);
|
||||
{
|
||||
constructor BPath.Create(dir : BDirectory; aLeaf : PChar; normalize : Boolean);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BPath_Create(Self, dir, aleaf, normalize);
|
||||
CPlusObject := BPath_Create(Self, dir, aLeaf, normalize);
|
||||
end;
|
||||
}
|
||||
constructor BPath.Create(apath : BPath);
|
||||
|
||||
constructor BPath.Create(aPath : BPath);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BPath_Create(Self, apath);
|
||||
CPlusObject := BPath_Create(Self, aPath);
|
||||
end;
|
||||
|
||||
constructor BPath.Create(entry : BEntry);
|
||||
@@ -96,7 +115,7 @@ begin
|
||||
CPlusObject := BPath_Create(Self, entry);
|
||||
end;
|
||||
|
||||
constructor BPath.Create_1(ref : EntryRef);
|
||||
constructor BPath.Create_1(ref : entry_ref);
|
||||
begin
|
||||
CreatePas;
|
||||
CPlusObject := BPath_Create(Self, ref);
|
||||
@@ -108,34 +127,36 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BPath.InitCheck : Status_t;
|
||||
function BPath.InitCheck : status_t;
|
||||
begin
|
||||
Result := BPath_InitCheck(CPlusObject);
|
||||
end;
|
||||
|
||||
function BPath.SetTo(apath : PChar; aleaf : PChar; normalize : boolean) : Status_t;
|
||||
function BPath.SetTo(aPath : PChar; aLeaf : PChar; normalize : Boolean) : status_t;
|
||||
begin
|
||||
Result := BPath_SetTo(CPlusObject, apath, aleaf, normalize);
|
||||
Result := BPath_SetTo(CPlusObject, aPath, aLeaf, normalize);
|
||||
end;
|
||||
|
||||
{function BPath.SetTo(dir : BDirectory; path : PChar; normalize : boolean) : Status_t;
|
||||
{
|
||||
function BPath.SetTo(dir : BDirectory; path : PChar; normalize : boolean) : Status_t;
|
||||
begin
|
||||
Result := BPath_SetTo(CPlusObject, dir, path, normalize);
|
||||
end;
|
||||
}
|
||||
function BPath.SetTo(entry : BEntry) : Status_t;
|
||||
|
||||
function BPath.SetTo(entry : BEntry) : status_t;
|
||||
begin
|
||||
Result := BPath_SetTo(CPlusObject, entry);
|
||||
end;
|
||||
|
||||
function BPath.SetTo_1(ref : PEntryRef) : Status_t;
|
||||
function BPath.SetTo_1(ref : PEntry_Ref) : status_t;
|
||||
begin
|
||||
Result := BPath_SetTo_3(CPlusObject, ref);
|
||||
end;
|
||||
|
||||
function BPath.Append(apath : PChar; normalize : boolean) : Status_t;
|
||||
function BPath.Append(aPath : PChar; normalize : Boolean) : status_t;
|
||||
begin
|
||||
Result := BPath_Append(CPlusObject,apath, normalize);
|
||||
Result := BPath_Append(CPlusObject, aPath, normalize);
|
||||
end;
|
||||
|
||||
procedure BPath.Unset;
|
||||
@@ -153,11 +174,9 @@ begin
|
||||
Result := BPath_Leaf(CPlusObject);
|
||||
end;
|
||||
|
||||
function BPath.GetParent( aPath: BPath) : Status_t;
|
||||
function BPath.GetParent(aPath: BPath) : status_t;
|
||||
begin
|
||||
Result := BPath_GetParent(CPlusObject, aPath.CPlusObject);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
end.
|
||||
@@ -2,51 +2,55 @@ unit StorageDefs;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
// from sys/param.h
|
||||
const
|
||||
|
||||
//----LIMITS--------------------------------
|
||||
// from sys/param.h
|
||||
NAME_MAX = 256;
|
||||
// from limits.h
|
||||
// from limits.h
|
||||
PATH_MAX = 1024;
|
||||
MAXPATHLEN = PATH_MAX;
|
||||
|
||||
B_FILE_NAME_LENGTH = NAME_MAX;
|
||||
B_PATH_NAME_LENGTH = MAXPATHLEN;
|
||||
B_ATTR_NAME_LENGTH = B_FILE_NAME_LENGTH - 1;
|
||||
B_MIME_TYPE_LENGTH = B_ATTR_NAME_LENGTH - 15;
|
||||
// B_MAX_SYMLINKS = SYMLINK_MAX;
|
||||
|
||||
// from fcntl.h
|
||||
|
||||
//----FILE OPEN MODES--------------------------------
|
||||
// from fcntl.h
|
||||
O_RDONLY = 0;
|
||||
O_WRONLY = 1;
|
||||
O_RDWR = 2;
|
||||
O_RDWR = 2;
|
||||
O_RWMASK = 3;
|
||||
|
||||
O_EXCL = $0100;
|
||||
O_CREAT = $0200;
|
||||
O_TRUNC = $0400;
|
||||
|
||||
O_EXCL = $0100;
|
||||
O_CREAT = $0200;
|
||||
O_TRUNC = $0400;
|
||||
O_APPEND = $0800;
|
||||
|
||||
// from StorageDefs.h
|
||||
B_READ_ONLY = O_RDONLY;
|
||||
B_READ_ONLY = O_RDONLY;
|
||||
B_WRITE_ONLY = O_WRONLY;
|
||||
B_READ_WRITE = O_RDWR;
|
||||
|
||||
B_FAIL_IF_EXISTS = O_EXCL;
|
||||
B_CREATE_FILE = O_CREAT;
|
||||
B_ERASE_FILE = O_TRUNC;
|
||||
B_OPEN_AT_END = O_APPEND;
|
||||
|
||||
// Node flavor
|
||||
B_FILE_NODE = $01;
|
||||
B_SYMLINK_NODE = $02;
|
||||
|
||||
B_FAIL_IF_EXISTS = O_EXCL; // exclusive create
|
||||
B_CREATE_FILE = O_CREAT; // create the file
|
||||
B_ERASE_FILE = O_TRUNC; // erase the file's data
|
||||
B_OPEN_AT_END = O_APPEND; // point to the end of the data
|
||||
|
||||
//----NODE FLAVORS--------------------------------
|
||||
B_FILE_NODE = $01;
|
||||
B_SYMLINK_NODE = $02;
|
||||
B_DIRECTORY_NODE = $04;
|
||||
B_ANY_NODE = $07;
|
||||
B_ANY_NODE = $07;
|
||||
|
||||
type
|
||||
// from types.h
|
||||
dev_t = integer;
|
||||
ino_t = int64;
|
||||
dev_t = Longint;
|
||||
ino_t = Int64;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
end.
|
||||
@@ -1,5 +1,6 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002-2003 Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
@@ -15,155 +16,171 @@
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit Volume;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, SupportDefs, os;
|
||||
BeObj, Bitmap, Mime, SupportDefs;
|
||||
|
||||
type
|
||||
BVolume = class(TBeObject)
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
BVolume = class(TBeObject)
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
|
||||
function InitCheck : Status_t;
|
||||
function SetTo(dev : Dev_t) : Status_t;
|
||||
procedure Unset;
|
||||
function Device : Dev_t;
|
||||
function Capacity : Off_t;
|
||||
function FreeBytes : Off_t;
|
||||
function GetName( name : pchar ):Status_t;
|
||||
function SetName( name : pchar ):Status_t;
|
||||
function IsRemovable : boolean;
|
||||
function IsReadOnly : boolean;
|
||||
function IsPersistent : boolean;
|
||||
function IsShared : boolean;
|
||||
function KnowsMime : boolean;
|
||||
function KnowsAttr : boolean;
|
||||
function KnowsQuery : boolean;
|
||||
|
||||
end;
|
||||
function InitCheck : status_t;
|
||||
function SetTo(dev : dev_t) : status_t;
|
||||
procedure Unset;
|
||||
function Device : dev_t;
|
||||
function Capacity : off_t;
|
||||
function FreeBytes : off_t;
|
||||
function GetName(name : PChar) : status_t;
|
||||
function SetName(name : PChar) : status_t;
|
||||
function IsRemovable : Boolean;
|
||||
function IsReadOnly : Boolean;
|
||||
function IsPersistent : Boolean;
|
||||
function IsShared : Boolean;
|
||||
function KnowsMime : Boolean;
|
||||
function KnowsAttr : Boolean;
|
||||
function KnowsQuery : Boolean;
|
||||
end;
|
||||
|
||||
function BVolume_Create : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BVolume_Create';
|
||||
function BVolume_Create_1(dev : dev_t) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BVolume_Create_1';
|
||||
function BVolume_Create_2(vol : TCPlusObject) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BVolume_Create_2';
|
||||
procedure BVolume_Free(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BVolume_BVolume';
|
||||
|
||||
function BVolume_Create: TCPlusObject;cdecl; external BePascalLibName name 'BVolume_Create';
|
||||
function BVolume_Create_1(dev :Dev_t ): TCPlusObject;cdecl; external BePascalLibName name 'BVolume_Create_1';
|
||||
function BVolume_Create_2(vol : TCPlusObject ): TCPlusObject;cdecl; external BePascalLibName name 'BVolume_Create_2';
|
||||
procedure BVolume_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BVolume_BVolume';
|
||||
|
||||
function BVolume_InitCheck(AObject : TCPlusObject) : Status_t;cdecl; external BePascalLibName name 'BVolume_InitCheck';
|
||||
function BVolume_SetTo(AObject : TCPlusObject; dev :Dev_t ): Status_t;cdecl; external BePascalLibName name 'BVolume_SetTo';
|
||||
procedure BVolume_Unset(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolume_Unset';
|
||||
function BVolume_Device(AObject : TCPlusObject) : Dev_t;cdecl; external BePascalLibName name 'BVolume_Device';
|
||||
//status_t BVolume_GetRootDirectory(BVolume *Volume, BDirectory *dir)
|
||||
function BVolume_Capacity(AObject : TCPlusObject) : Off_t;cdecl; external BePascalLibName name 'BVolume_Capacity';
|
||||
function BVolume_FreeBytes(AObject : TCPlusObject) : Off_t;cdecl; external BePascalLibName name 'BVolume_FreeBytes';
|
||||
function BVolume_GetName(AObject : TCPlusObject; name : pchar ): Status_t;cdecl; external BePascalLibName name 'BVolume_GetName';
|
||||
function BVolume_SetName(AObject : TCPlusObject; name : pchar ): Status_t;cdecl; external BePascalLibName name 'BVolume_SetName';
|
||||
//status_t BVolume_GetIcon(BVolume *Volume, BBitmap *icon, icon_size which)
|
||||
function BVolume_IsRemovable(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_IsRemovable';
|
||||
|
||||
function BVolume_IsReadOnly(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_IsReadOnly';
|
||||
function BVolume_IsPersistent(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_IsPersistent';
|
||||
function BVolume_IsShared(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_IsShared';
|
||||
function BVolume_KnowsMime(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_KnowsMime';
|
||||
function BVolume_KnowsAttr(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_KnowsAttr';
|
||||
function BVolume_KnowsQuery(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BVolume_KnowsQuery';
|
||||
|
||||
function BVolume_InitCheck(AObject : TCPlusObject) : status_t;
|
||||
cdecl; external BePascalLibName name 'BVolume_InitCheck';
|
||||
function BVolume_SetTo(AObject : TCPlusObject; dev : dev_t) : status_t;
|
||||
cdecl; external BePascalLibName name 'BVolume_SetTo';
|
||||
procedure BVolume_Unset(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BVolume_Unset';
|
||||
function BVolume_Device(AObject : TCPlusObject) : dev_t;
|
||||
cdecl; external BePascalLibName name 'BVolume_Device';
|
||||
|
||||
//status_t BVolume_GetRootDirectory(BVolume *Volume, BDirectory *dir)
|
||||
//function BVolume_GetRootDirectory(AObject : TCPlusObject; var dir BDirectory) : status_t;
|
||||
// cdecl; external BePascalLibName name 'BVolume_GetRootDirectory';
|
||||
|
||||
function BVolume_Capacity(AObject : TCPlusObject) : off_t;
|
||||
cdecl; external BePascalLibName name 'BVolume_Capacity';
|
||||
function BVolume_FreeBytes(AObject : TCPlusObject) : off_t;
|
||||
cdecl; external BePascalLibName name 'BVolume_FreeBytes';
|
||||
function BVolume_GetName(AObject : TCPlusObject; name : PChar) : Status_t;
|
||||
cdecl; external BePascalLibName name 'BVolume_GetName';
|
||||
function BVolume_SetName(AObject : TCPlusObject; name : PChar) : Status_t;
|
||||
cdecl; external BePascalLibName name 'BVolume_SetName';
|
||||
function BVolume_GetIcon(AObject : TCPlusObject; var icon : BBitmap;
|
||||
wich : icon_size) : status_t;
|
||||
cdecl; external BePascalLibName name 'BVolume_GetIcon';
|
||||
function BVolume_IsRemovable(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BVolume_IsRemovable';
|
||||
function BVolume_IsReadOnly(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BVolume_IsReadOnly';
|
||||
function BVolume_IsPersistent(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BVolume_IsPersistent';
|
||||
function BVolume_IsShared(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BVolume_IsShared';
|
||||
function BVolume_KnowsMime(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BVolume_KnowsMime';
|
||||
function BVolume_KnowsAttr(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BVolume_KnowsAttr';
|
||||
function BVolume_KnowsQuery(AObject : TCPlusObject) : Boolean;
|
||||
cdecl; external BePascalLibName name 'BVolume_KnowsQuery';
|
||||
|
||||
implementation
|
||||
|
||||
constructor BVolume.Create;
|
||||
begin
|
||||
inherited;
|
||||
CPlusObject:=BVolume_Create;
|
||||
inherited;
|
||||
CPlusObject := BVolume_Create;
|
||||
end;
|
||||
|
||||
|
||||
destructor BVolume.Destroy;
|
||||
begin
|
||||
if CPlusObject <> nil then BVolume_Free(CPlusObject);
|
||||
inherited;
|
||||
if CPlusObject <> nil then BVolume_Free(CPlusObject);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function BVolume.InitCheck: Status_t;
|
||||
function BVolume.InitCheck : status_t;
|
||||
begin
|
||||
result:=BVolume_InitCheck(CPlusObject);
|
||||
Result := BVolume_InitCheck(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.SetTo(dev : Dev_t) : Status_t;
|
||||
function BVolume.SetTo(dev : dev_t) : status_t;
|
||||
begin
|
||||
result:=BVolume_SetTo(CPlusObject,dev);
|
||||
Result := BVolume_SetTo(CPlusObject, dev);
|
||||
end;
|
||||
|
||||
procedure BVolume.Unset;
|
||||
begin
|
||||
BVolume_Unset(CPlusObject);
|
||||
BVolume_Unset(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.Device : Dev_t;
|
||||
function BVolume.Device : dev_t;
|
||||
begin
|
||||
result:=BVolume_Device(CPlusObject);
|
||||
Result := BVolume_Device(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.Capacity : Off_t;
|
||||
function BVolume.Capacity : off_t;
|
||||
begin
|
||||
result:=BVolume_Capacity(CPlusObject);
|
||||
Result := BVolume_Capacity(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.FreeBytes : Off_t;
|
||||
function BVolume.FreeBytes : off_t;
|
||||
begin
|
||||
result:=BVolume_FreeBytes(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.GetName( name : pchar ):Status_t;
|
||||
begin
|
||||
result:=BVolume_GetName(CPlusObject,name);
|
||||
Result := BVolume_FreeBytes(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.SetName( name : pchar ):Status_t;
|
||||
function BVolume.GetName(name : PChar) : status_t;
|
||||
begin
|
||||
result:=BVolume_SetName(CPlusObject,name);
|
||||
end;
|
||||
|
||||
function BVolume.IsRemovable : boolean;
|
||||
begin
|
||||
result:=BVolume_IsRemovable(CPlusObject);
|
||||
Result := BVolume_GetName(CPlusObject, name);
|
||||
end;
|
||||
|
||||
function BVolume.IsReadOnly : boolean;
|
||||
function BVolume.SetName(name : PChar) : status_t;
|
||||
begin
|
||||
result:=BVolume_IsReadOnly(CPlusObject);
|
||||
Result := BVolume_SetName(CPlusObject, name);
|
||||
end;
|
||||
|
||||
function BVolume.IsPersistent : boolean;
|
||||
function BVolume.IsRemovable : Boolean;
|
||||
begin
|
||||
result:=BVolume_IsPersistent(CPlusObject);
|
||||
Result := BVolume_IsRemovable(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.IsShared : boolean;
|
||||
function BVolume.IsReadOnly : Boolean;
|
||||
begin
|
||||
result:=BVolume_IsShared(CPlusObject);
|
||||
Result := BVolume_IsReadOnly(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.KnowsMime : boolean;
|
||||
function BVolume.IsPersistent : Boolean;
|
||||
begin
|
||||
result:=BVolume_KnowsMime(CPlusObject);
|
||||
Result := BVolume_IsPersistent(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.KnowsAttr : boolean;
|
||||
function BVolume.IsShared : Boolean;
|
||||
begin
|
||||
result:=BVolume_KnowsAttr(CPlusObject);
|
||||
Result := BVolume_IsShared(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.KnowsQuery : boolean;
|
||||
function BVolume.KnowsMime : Boolean;
|
||||
begin
|
||||
result:=BVolume_KnowsQuery(CPlusObject);
|
||||
Result := BVolume_KnowsMime(CPlusObject);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
function BVolume.KnowsAttr : Boolean;
|
||||
begin
|
||||
Result := BVolume_KnowsAttr(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolume.KnowsQuery : Boolean;
|
||||
begin
|
||||
Result := BVolume_KnowsQuery(CPlusObject);
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -1,5 +1,6 @@
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 Eric Jourde
|
||||
{ BePascal - A pascal wrapper around the BeOS API
|
||||
Copyright (C) 2002 - 2003 Eric Jourde
|
||||
Oscar Lesta
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
@@ -15,61 +16,71 @@
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit volumeroster;
|
||||
unit VolumeRoster;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
beobj, SupportDefs, os , Volume;
|
||||
|
||||
BeObj, Messenger, SupportDefs, Volume;
|
||||
|
||||
type
|
||||
BVolumeRoster = class(TBeObject)
|
||||
private
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
|
||||
function GetNextVolume(val : TVolume): Status_t;
|
||||
procedure Rewind;
|
||||
function GetBootVolume( vol: TVolume ):Status_t;
|
||||
//function StartWatching( msngr : TMessenger): Status_t;
|
||||
procedure StopWatching;
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
|
||||
function GetNextVolume(var vol : BVolume): status_t;
|
||||
procedure Rewind;
|
||||
|
||||
function GetBootVolume(var vol : BVolume) : status_t;
|
||||
function StartWatching(msngr : BMessenger {$ifndef VER1_0}= be_app_messenger{$endif}): status_t;
|
||||
procedure StopWatching;
|
||||
function Messenger : BMessenger;
|
||||
end;
|
||||
|
||||
|
||||
function BVolumeRoster_Create(AObject : TBeObject): TCPlusObject;cdecl; external BePascalLibName name 'BVolumeRoster_Create';
|
||||
procedure BVolumeRoster_Free(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_Free';
|
||||
function BVolumeRoster_Create(AObject : TBeObject) : TCPlusObject;
|
||||
cdecl; external BePascalLibName name 'BVolumeRoster_Create';
|
||||
|
||||
function BVolumeRoster_GetNextVolume(AObject : TCPlusObject;vol : TCPlusObject): Status_t;cdecl; external BePascalLibName name 'BVolumeRoster_GetNextVolume';
|
||||
procedure BVolumeRoster_Rewind(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_Rewind';
|
||||
function BVolumeRoster_GetBootVolume(AObject : TCPlusObject; vol: TCPlusObject ):Status_t;cdecl; external BePascalLibName name 'BVolumeRoster_GetBootVolume';
|
||||
//function BVolumeRoster_StartWatching(AObject : TCPlusObject; msngr : TMessenger): Status_t;cdecl; external BePascalLibName name 'BVolumeRoster_StartWatching';
|
||||
procedure BVolumeRoster_StopWatching(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BVolumeRoster_StopWatching';
|
||||
procedure BVolumeRoster_Free(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BVolumeRoster_Free';
|
||||
|
||||
function BVolumeRoster_GetNextVolume(AObject : TCPlusObject; vol : TCPlusObject)
|
||||
: Status_t; cdecl; external BePascalLibName name 'BVolumeRoster_GetNextVolume';
|
||||
|
||||
procedure BVolumeRoster_Rewind(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BVolumeRoster_Rewind';
|
||||
|
||||
function BVolumeRoster_GetBootVolume(AObject : TCPlusObject; vol : TCPlusObject)
|
||||
: Status_t; cdecl; external BePascalLibName name 'BVolumeRoster_GetBootVolume';
|
||||
|
||||
function BVolumeRoster_StartWatching(AObject : TCPlusObject; msngr : BMessenger)
|
||||
: Status_t; cdecl; external BePascalLibName name 'BVolumeRoster_StartWatching';
|
||||
|
||||
procedure BVolumeRoster_StopWatching(AObject : TCPlusObject);
|
||||
cdecl; external BePascalLibName name 'BVolumeRoster_StopWatching';
|
||||
|
||||
function BVolumeRoster_Messenger(AObject : TCPlusObject)
|
||||
: BMessenger; cdecl; external BePascalLibName name 'BVolumeRoster_Messenger';
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
constructor BVolumeRoster.Create;
|
||||
constructor BVolumeRoster.Create;
|
||||
begin
|
||||
inherited;
|
||||
CPlusObject := BVolumeRoster_Create(Self);
|
||||
end;
|
||||
|
||||
destructor BVolumeRoster.Destroy;
|
||||
destructor BVolumeRoster.Destroy;
|
||||
begin
|
||||
if CPlusObject <> nil then
|
||||
BVolumeRoster_Free(CPlusObject);
|
||||
inherited;
|
||||
|
||||
end;
|
||||
|
||||
function BVolumeRoster.GetNextVolume(val : TVolume): Status_t;
|
||||
function BVolumeRoster.GetNextVolume(var vol : BVolume) : status_t;
|
||||
begin
|
||||
result:=BVolumeRoster_GetNextVolume(CPlusObject,val.CPlusObject);
|
||||
Result := BVolumeRoster_GetNextVolume(CPlusObject, vol.CPlusObject);
|
||||
end;
|
||||
|
||||
procedure BVolumeRoster.Rewind;
|
||||
@@ -77,19 +88,24 @@ begin
|
||||
BVolumeRoster_Rewind(CPlusObject);
|
||||
end;
|
||||
|
||||
function BVolumeRoster.GetBootVolume( vol: TVolume ):Status_t;
|
||||
function BVolumeRoster.GetBootVolume(var vol : BVolume) : status_t;
|
||||
begin
|
||||
result:=BVolumeRoster_GetBootVolume(CPlusObject,vol.CPlusObject);
|
||||
Result := BVolumeRoster_GetBootVolume(CPlusObject, vol.CPlusObject);
|
||||
end;
|
||||
|
||||
//function BVolumeRoster.StartWatching( msngr : TMessenger): Status_t;
|
||||
//begin
|
||||
// result:=BVolumeRoster_StartWatching(CPlusObject,msngr);
|
||||
//end;
|
||||
function BVolumeRoster.StartWatching(msngr : BMessenger) : status_t;
|
||||
begin
|
||||
Result := BVolumeRoster_StartWatching(CPlusObject, msngr);
|
||||
end;
|
||||
|
||||
procedure BVolumeRoster.StopWatching;
|
||||
begin
|
||||
BVolumeRoster_StopWatching(CPlusObject);
|
||||
end;
|
||||
|
||||
end.
|
||||
function BVolumeRoster.Messenger : BMessenger;
|
||||
begin
|
||||
Result := BVolumeRoster_Messenger(CPlusObject);
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user