diff --git a/bepascal/source/bepascal/cpp/src/be/app/Cursor.cpp b/bepascal/source/bepascal/cpp/src/be/app/Cursor.cpp new file mode 100644 index 0000000..7350f1c --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/app/Cursor.cpp @@ -0,0 +1,148 @@ +/* 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 +*/ + +#ifndef _CURSOR_CPP_ +#define _CURSOR_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Screen.cpp + * DATE: Wed Sep 24 20:58:44 2003 + * DESCR: + ***********************************************************************/ +#include "Cursor.h" +#include + + + +class BPCursor : public BCursor, virtual public BPasObject +{ + public: + BPCursor(TPasObject PasObject,const void *cursorData); + BPCursor(TPasObject PasObject,BMessage *data); + private: +}; + + + +BPCursor::BPCursor(TPasObject PasObject,const void *cursorData) + :BCursor(cursorData), + BPasObject(PasObject) + +{ +}; +BPCursor::BPCursor(TPasObject PasObject,BMessage *data) + :BCursor(data), + BPasObject(PasObject) + +{ +}; + + +#if defined(__cplusplus) +extern "C" { +#endif/*********************************************************************** + * AUTHOR: nobody + * FILE: Cursor.cpp + * DATE: Sat Sep 27 21:25:18 2003 + * DESCR: + ***********************************************************************/ + + +/*********************************************************************** + * Method: BCursor::BCursor + * Params: const void *cursorData + * Effects: + ***********************************************************************/ +TCPlusObject BCursor_Create(TPasObject PasObject, const void *cursorData) +{ + return new BPCursor(PasObject, cursorData); +} + + +/*********************************************************************** + * Method: BCursor::BCursor + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BCursor_Create_1 +(TPasObject PasObject, BMessage *data) +{ + return new BPCursor(PasObject, data); +} + + +/*********************************************************************** + * Method: BCursor::~BCursor + * Params: + * Effects: + ***********************************************************************/ +void BCursor_Free(BCursor *Cursor) +{ + delete Cursor; +} + + +/*********************************************************************** + * Method: BCursor::Archive + * Params: BMessage *into, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BCursor_Archive(BCursor *Cursor, BMessage *into, bool deep) +{ + return Cursor->Archive(into, deep); +} + + +/*********************************************************************** + * Method: BCursor::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BCursor_Instantiate(BCursor *Cursor, BMessage *data) +{ + return Cursor->Instantiate(data); +} + + +/*********************************************************************** + * Method: BCursor::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BCursor_Perform(BCursor *Cursor, perform_code d, void *arg) +{ + return Cursor->Perform(d, arg); +} + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _REGION_CPP_ */ + + diff --git a/bepascal/source/bepascal/cpp/src/be/interface/Shape.cpp b/bepascal/source/bepascal/cpp/src/be/interface/Shape.cpp new file mode 100644 index 0000000..793c900 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/interface/Shape.cpp @@ -0,0 +1,341 @@ +/* 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 +*/ + +#ifndef _SHAPE_CPP_ +#define _SHAPE_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Shape.cpp + * DATE: Sat Oct 11 20:54:15 2003 + * DESCR: + ***********************************************************************/ +#include +#include +#include "Shape.h" + + +class BPShapeIterator : public BShapeIterator, virtual public BPasObject +{ + public: + BPShapeIterator(TPasObject PasObject); + + private: +}; + +BPShapeIterator::BPShapeIterator(TPasObject PasObject) + :BShapeIterator(), + BPasObject(PasObject) + +{ +} + + +class BPShape : public BShape, virtual public BPasObject +{ + public: + BPShape(TPasObject PasObject); + BPShape(TPasObject PasObject,const BShape ©From); + BPShape(TPasObject PasObject, BMessage *data); + + private: +}; + +BPShape::BPShape(TPasObject PasObject) + :BShape(), + BPasObject(PasObject) + +{ +} +BPShape::BPShape(TPasObject PasObject, const BShape ©From) + :BShape(copyFrom), + BPasObject(PasObject) + +{ +} +BPShape::BPShape(TPasObject PasObject, BMessage *data) + :BShape(data), + BPasObject(PasObject) + +{ +} + + +#if defined(__cplusplus) +extern "C" { +#endif +/*********************************************************************** + * Method: BShapeIterator::BShapeIterator + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BShapeIterator_Create(TPasObject PasObject) +{ + return new BPShapeIterator(PasObject); +} + + +/*********************************************************************** + * Method: BShapeIterator::~BShapeIterator + * Params: + * Effects: + ***********************************************************************/ +void BShapeIterator_Free(BShapeIterator *ShapeIterator) +{ + delete ShapeIterator; +} + + +/*********************************************************************** + * Method: BShapeIterator::IterateMoveTo + * Params: BPoint *point + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShapeIterator_IterateMoveTo(BShapeIterator *ShapeIterator, BPoint *point) +{ + return ShapeIterator->IterateMoveTo(point); +} + + +/*********************************************************************** + * Method: BShapeIterator::IterateLineTo + * Params: int32 lineCount, BPoint *linePts + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShapeIterator_IterateLineTo(BShapeIterator *ShapeIterator, int32 lineCount, BPoint *linePts) +{ + return ShapeIterator->IterateLineTo(lineCount, linePts); +} + + +/*********************************************************************** + * Method: BShapeIterator::IterateBezierTo + * Params: int32 bezierCount, BPoint *bezierPts + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShapeIterator_IterateBezierTo(BShapeIterator *ShapeIterator, int32 bezierCount, BPoint *bezierPts) +{ + return ShapeIterator->IterateBezierTo(bezierCount, bezierPts); +} + + +/*********************************************************************** + * Method: BShapeIterator::IterateClose + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShapeIterator_IterateClose(BShapeIterator *ShapeIterator) +{ + return ShapeIterator->IterateClose(); +} + + +/*********************************************************************** + * Method: BShapeIterator::Iterate + * Params: BShape *shape + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShapeIterator_Iterate(BShapeIterator *ShapeIterator, BShape *shape) +{ + return ShapeIterator->Iterate(shape); +} + + + + +/*********************************************************************** + * Method: BShape::BShape + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BShape_Create(TPasObject PasObject) +{ + return new BPShape(PasObject); +} + + +/*********************************************************************** + * Method: BShape::BShape + * Params: const BShape ©From + * Effects: + ***********************************************************************/ +TCPlusObject BShape_Create_1 +(TPasObject PasObject, const BShape ©From) +{ + return new BPShape(PasObject, copyFrom); +} + + +/*********************************************************************** + * Method: BShape::BShape + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BShape_Create_2 +(TPasObject PasObject, BMessage *data) +{ + return new BPShape(PasObject, data); +} + + +/*********************************************************************** + * Method: BShape::~BShape + * Params: + * Effects: + ***********************************************************************/ +void BShape_Free(BShape *Shape) +{ + delete Shape; +} + + +/*********************************************************************** + * Method: BShape::Archive + * Params: BMessage *into, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShape_Archive(BShape *Shape, BMessage *into, bool deep) +{ + return Shape->Archive(into, deep); +} + + +/*********************************************************************** + * Method: BShape::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BShape_Instantiate(BShape *Shape, BMessage *data) +{ + return Shape->Instantiate(data); +} + + +/*********************************************************************** + * Method: BShape::Clear + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BShape_Clear(BShape *Shape) +{ + Shape->Clear(); +} + + +/*********************************************************************** + * Method: BShape::Bounds + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BShape_Bounds(BShape *Shape) +{ + return Shape->Bounds(); +} + + +/*********************************************************************** + * Method: BShape::AddShape + * Params: const BShape *other + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShape_AddShape(BShape *Shape, const BShape *other) +{ + return Shape->AddShape(other); +} + + +/*********************************************************************** + * Method: BShape::MoveTo + * Params: BPoint point + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShape_MoveTo(BShape *Shape, BPoint point) +{ + return Shape->MoveTo(point); +} + + +/*********************************************************************** + * Method: BShape::LineTo + * Params: BPoint linePoint + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShape_LineTo(BShape *Shape, BPoint linePoint) +{ + return Shape->LineTo(linePoint); +} + + +/*********************************************************************** + * Method: BShape::BezierTo + * Params: BPoint controlPoints[3] + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShape_BezierTo(BShape *Shape, BPoint controlPoints[3]) +{ + return Shape->BezierTo(controlPoints); +} + + +/*********************************************************************** + * Method: BShape::Close + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BShape_Close(BShape *Shape) +{ + return Shape->Close(); +} + + + + +#if defined(__cplusplus) +} +#endif + + +#endif _SHAPE_CPP_ /* _SHAPE_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/storage/File.cpp b/bepascal/source/bepascal/cpp/src/be/storage/File.cpp new file mode 100644 index 0000000..52a5d1a --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/storage/File.cpp @@ -0,0 +1,351 @@ +/* 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 +*/ + +#ifndef _FILE_CPP_ +#define _FILE_CPP_ + +/*********************************************************************** + * AUTHOR: + * FILE: Entry.cpp + * DATE: Wed Jul 2 22:28:34 2003 + * DESCR: + ***********************************************************************/ +#include "Resources.h" +#include + + + +class BPFile : public BFile, public virtual BPasObject { +public: + BPFile(TPasObject PasObject); + BPFile(TPasObject PasObject,const entry_ref *ref, uint32 open_mode); + BPFile(TPasObject PasObject,const BEntry *entry, uint32 open_mode); + BPFile(TPasObject PasObject,const char *path, uint32 open_mode); + BPFile(TPasObject PasObject,const BDirectory *dir, const char *path, + uint32 open_mode); + BPFile(TPasObject PasObject,const BFile &file); + +virtual ~BPFile(); +}; + +BPFile::BPFile(TPasObject PasObject) + :BFile(), + BPasObject(PasObject) +{ +} +BPFile::BPFile(TPasObject PasObject,const entry_ref *ref, uint32 open_mode) + :BFile(ref,open_mode), + BPasObject(PasObject) +{ +} +BPFile::BPFile(TPasObject PasObject,const BEntry *entry, uint32 open_mode) + :BFile(entry,open_mode), + BPasObject(PasObject) +{ +} +BPFile::BPFile(TPasObject PasObject,const char *path, uint32 open_mode) + :BFile(path,open_mode), + BPasObject(PasObject) +{ +} +BPFile::BPFile(TPasObject PasObject,const BDirectory *dir, const char *path, + uint32 open_mode) + :BFile(dir,path,open_mode), + BPasObject(PasObject) +{ +} +BPFile::BPFile(TPasObject PasObject,const BFile &file) + :BFile(file), + BPasObject(PasObject) +{ +} + +BPFile::~BPFile() +{ +} + +#if defined(__cplusplus) +extern "C" { +#endif + + +/*********************************************************************** + * Method: BFile::BFile + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BFile_Create(TPasObject PasObject) +{ + return new BPFile(PasObject); +} + + +/*********************************************************************** + * Method: BFile::BFile + * Params: const entry_ref *ref, uint32 open_mode + * Effects: + ***********************************************************************/ +TCPlusObject BFile_Create_1 +(TPasObject PasObject, const entry_ref *ref, uint32 open_mode) +{ + return new BPFile(PasObject, ref, open_mode); +} + + +/*********************************************************************** + * Method: BFile::BFile + * Params: const BEntry *entry, uint32 open_mode + * Effects: + ***********************************************************************/ +TCPlusObject BFile_Create_2 +(TPasObject PasObject, const BEntry *entry, uint32 open_mode) +{ + return new BPFile(PasObject, entry, open_mode); +} + + +/*********************************************************************** + * Method: BFile::BFile + * Params: const char *path, uint32 open_mode + * Effects: + ***********************************************************************/ +TCPlusObject BFile_Create_3 +(TPasObject PasObject, const char *path, uint32 open_mode) +{ + return new BPFile(PasObject, path, open_mode); +} + + +/*********************************************************************** + * Method: BFile::BFile + * Params: const BDirectory *dir, const char *path, uint32 open_mode + * Effects: + ***********************************************************************/ +TCPlusObject BFile_Create_4 +(TPasObject PasObject, const BDirectory *dir, const char *path, uint32 open_mode) +{ + return new BPFile(PasObject, dir, path, open_mode); +} + + +/*********************************************************************** + * Method: BFile::BFile + * Params: const BFile &file + * Effects: + ***********************************************************************/ +TCPlusObject BFile_Create_5 +(TPasObject PasObject, const BFile &file) +{ + return new BPFile(PasObject, file); +} + + +/*********************************************************************** + * Method: BFile::~BFile + * Params: + * Effects: + ***********************************************************************/ +void BFile_FREE(BFile *File) +{ + delete File; +} + + +/*********************************************************************** + * Method: BFile::SetTo + * Params: const entry_ref *ref, uint32 open_mode + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFile_SetTo(BFile *File, const entry_ref *ref, uint32 open_mode) +{ + return File->SetTo(ref, open_mode); +} + + +/*********************************************************************** + * Method: BFile::SetTo + * Params: const BEntry *entry, uint32 open_mode + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFile_SetTo_1 +(BFile *File, const BEntry *entry, uint32 open_mode) +{ + return File->SetTo(entry, open_mode); +} + + +/*********************************************************************** + * Method: BFile::SetTo + * Params: const char *path, uint32 open_mode + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFile_SetTo_2 +(BFile *File, const char *path, uint32 open_mode) +{ + return File->SetTo(path, open_mode); +} + + +/*********************************************************************** + * Method: BFile::SetTo + * Params: const BDirectory *dir, const char *path, uint32 open_mode + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFile_SetTo_3 +(BFile *File, const BDirectory *dir, const char *path, uint32 open_mode) +{ + return File->SetTo(dir, path, open_mode); +} + + +/*********************************************************************** + * Method: BFile::IsReadable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFile_IsReadable(BFile *File) +{ + return File->IsReadable(); +} + + +/*********************************************************************** + * Method: BFile::IsWritable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFile_IsWritable(BFile *File) +{ + return File->IsWritable(); +} + + +/*********************************************************************** + * Method: BFile::Read + * Params: void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BFile_Read(BFile *File, void *buffer, size_t size) +{ + return File->Read(buffer, size); +} + + +/*********************************************************************** + * Method: BFile::ReadAt + * Params: off_t pos, void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BFile_ReadAt_1 +(BFile *File, off_t pos, void *buffer, size_t size) +{ + return File->ReadAt(pos, buffer, size); +} + + +/*********************************************************************** + * Method: BFile::Write + * Params: const void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BFile_Write(BFile *File, const void *buffer, size_t size) +{ + return File->Write(buffer, size); +} + + +/*********************************************************************** + * Method: BFile::WriteAt + * Params: off_t pos, const void *buffer, size_t size + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BFile_WriteAt_1 +(BFile *File, off_t pos, const void *buffer, size_t size) +{ + return File->WriteAt(pos, buffer, size); +} + + +/*********************************************************************** + * Method: BFile::Seek + * Params: off_t position, uint32 seek_mode + * Returns: off_t + * Effects: + ***********************************************************************/ +off_t +BFile_Seek(BFile *File, off_t position, uint32 seek_mode) +{ + return File->Seek(position, seek_mode); +} + + +/*********************************************************************** + * Method: BFile::Position + * Params: + * Returns: off_t + * Effects: + ***********************************************************************/ +off_t +BFile_Position(BFile *File) +{ + return File->Position(); +} + + +/*********************************************************************** + * Method: BFile::SetSize + * Params: off_t size + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFile_SetSize(BFile *File, off_t size) +{ + return File->SetSize(size); +} + + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _FILE_CPP_ */ \ No newline at end of file diff --git a/bepascal/source/bepascal/cpp/src/be/storage/Node.cpp b/bepascal/source/bepascal/cpp/src/be/storage/Node.cpp new file mode 100644 index 0000000..4e8f376 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/storage/Node.cpp @@ -0,0 +1,441 @@ +/* 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 +*/ + + +#ifndef _NODE_CPP_ +#define _NODE_CPP_ + +/*********************************************************************** + * AUTHOR: + * FILE: Entry.cpp + * DATE: Wed Jul 2 22:28:34 2003 + * DESCR: + ***********************************************************************/ +#include "Node.h" +#include + + + +class BPNode : public BNode, public virtual BPasObject { +public: + BPNode(TPasObject PasObject); + BPNode(TPasObject PasObject,const entry_ref *ref); + BPNode(TPasObject PasObject,const BEntry *entry); + BPNode(TPasObject PasObject,const char *path); + BPNode(TPasObject PasObject,const BDirectory *dir, const char *path); + BPNode(TPasObject PasObject,const BNode &node); + + virtual ~BPNode(); +}; + + +BPNode::BPNode(TPasObject PasObject) + :BNode(), + BPasObject(PasObject) +{ +} +BPNode::BPNode(TPasObject PasObject,const entry_ref *ref) + :BNode(ref), + BPasObject(PasObject) +{ +} +BPNode::BPNode(TPasObject PasObject,const BEntry *entry) + :BNode(entry), + BPasObject(PasObject) +{ +} +BPNode::BPNode(TPasObject PasObject,const char *path) + :BNode(path), + BPasObject(PasObject) +{ +} +BPNode::BPNode(TPasObject PasObject,const BDirectory *dir, const char *path) + :BNode(dir,path), + BPasObject(PasObject) +{ +} +BPNode::BPNode(TPasObject PasObject,const BNode &node) + :BNode(node), + BPasObject(PasObject) +{ +} + +BPNode::~BPNode() +{ +} + +#if defined(__cplusplus) +extern "C" { +#endif + + + +/*********************************************************************** + * Method: BNode::BNode + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BNode_Create(TPasObject PasObject) +{ + return new BPNode(PasObject); +} + + +/*********************************************************************** + * Method: BNode::BNode + * Params: const entry_ref *ref + * Effects: + ***********************************************************************/ +TCPlusObject BNode_Create_1 +(TPasObject PasObject, const entry_ref *ref) +{ + return new BPNode(PasObject, ref); +} + + +/*********************************************************************** + * Method: BNode::BNode + * Params: const BEntry *entry + * Effects: + ***********************************************************************/ +TCPlusObject BNode_Create_2 +(TPasObject PasObject, const BEntry *entry) +{ + return new BPNode(PasObject, entry); +} + + +/*********************************************************************** + * Method: BNode::BNode + * Params: const char *path + * Effects: + ***********************************************************************/ +TCPlusObject BNode_Create_3 +(TPasObject PasObject, const char *path) +{ + return new BPNode(PasObject, path); +} + + +/*********************************************************************** + * Method: BNode::BNode + * Params: const BDirectory *dir, const char *path + * Effects: + ***********************************************************************/ +TCPlusObject BNode_Create_4 +(TPasObject PasObject, const BDirectory *dir, const char *path) +{ + return new BPNode(PasObject, dir, path); +} + + +/*********************************************************************** + * Method: BNode::BNode + * Params: const BNode &node + * Effects: + ***********************************************************************/ +TCPlusObject BNode_Create_5 +(TPasObject PasObject, const BNode &node) +{ + return new BPNode(PasObject, node); +} + + +/*********************************************************************** + * Method: BNode::~BNode + * Params: + * Effects: + ***********************************************************************/ +void BNode_Free(BNode *Node) +{ + delete Node; +} + + +/*********************************************************************** + * Method: BNode::InitCheck + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_InitCheck(BNode *Node) +{ + return Node->InitCheck(); +} + + +/*********************************************************************** + * Method: BNode::GetStat + * Params: struct stat *st + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_GetStat(BNode *Node, struct stat *st) +{ + return Node->GetStat(st); +} + + +/*********************************************************************** + * Method: BNode::SetTo + * Params: const entry_ref *ref + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_SetTo(BNode *Node, const entry_ref *ref) +{ + return Node->SetTo(ref); +} + + +/*********************************************************************** + * Method: BNode::SetTo + * Params: const BEntry *entry + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_SetTo_1 +(BNode *Node, const BEntry *entry) +{ + return Node->SetTo(entry); +} + + +/*********************************************************************** + * Method: BNode::SetTo + * Params: const char *path + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_SetTo_2 +(BNode *Node, const char *path) +{ + return Node->SetTo(path); +} + + +/*********************************************************************** + * Method: BNode::SetTo + * Params: const BDirectory *dir, const char *path + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_SetTo_3 +(BNode *Node, const BDirectory *dir, const char *path) +{ + return Node->SetTo(dir, path); +} + + +/*********************************************************************** + * Method: BNode::Unset + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BNode_Unset(BNode *Node) +{ + Node->Unset(); +} + + +/*********************************************************************** + * Method: BNode::Lock + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_Lock(BNode *Node) +{ + return Node->Lock(); +} + + +/*********************************************************************** + * Method: BNode::Unlock + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_Unlock(BNode *Node) +{ + return Node->Unlock(); +} + + +/*********************************************************************** + * Method: BNode::Sync + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_Sync(BNode *Node) +{ + return Node->Sync(); +} + + +/*********************************************************************** + * Method: BNode::WriteAttr + * Params: const char *attr, type_code type, off_t off, const void *buf, size_t l + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BNode_WriteAttr(BNode *Node, const char *attr, type_code type, off_t off, const void *buf, size_t l) +{ + return Node->WriteAttr(attr, type, off, buf, l); +} + + +/*********************************************************************** + * Method: BNode::ReadAttr + * Params: const char *attr, type_code type, off_t off, void *buf, size_t l + * Returns: ssize_t + * Effects: + ***********************************************************************/ +ssize_t +BNode_ReadAttr(BNode *Node, const char *attr, type_code type, off_t off, void *buf, size_t l) +{ + return Node->ReadAttr(attr, type, off, buf, l); +} + + +/*********************************************************************** + * Method: BNode::RemoveAttr + * Params: const char *attr + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_RemoveAttr(BNode *Node, const char *attr) +{ + return Node->RemoveAttr(attr); +} + + +/*********************************************************************** + * Method: BNode::RenameAttr + * Params: const char *oldname, const char *newname + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_RenameAttr(BNode *Node, const char *oldname, const char *newname) +{ + return Node->RenameAttr(oldname, newname); +} + + +/*********************************************************************** + * Method: BNode::GetAttrInfo + * Params: const char *attr, struct attr_info *buf + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_GetAttrInfo(BNode *Node, const char *attr, struct attr_info *buf) +{ + return Node->GetAttrInfo(attr, buf); +} + + +/*********************************************************************** + * Method: BNode::GetNextAttrName + * Params: char *buf + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_GetNextAttrName(BNode *Node, char *buf) +{ + return Node->GetNextAttrName(buf); +} + + +/*********************************************************************** + * Method: BNode::RewindAttrs + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_RewindAttrs(BNode *Node) +{ + return Node->RewindAttrs(); +} + + +/*********************************************************************** + * Method: BNode::WriteAttrString + * Params: const char *attr, const BString * + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_WriteAttrString(BNode *Node, const char *attr, const BString *a) +{ + return Node->WriteAttrString(attr, a); +} + + +/*********************************************************************** + * Method: BNode::ReadAttrString + * Params: const char *attr, BString *result + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BNode_ReadAttrString(BNode *Node, const char *attr, BString *result) +{ + return Node->ReadAttrString(attr, result); +} + + + +/*********************************************************************** + * Method: BNode::Dup + * Params: + * Returns: int + * Effects: + ***********************************************************************/ +int +BNode_Dup(BNode *Node) +{ + return Node->Dup(); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _NODE_CPP_ */ diff --git a/bepascal/source/bepascal/cpp/src/be/storage/Resources.cpp b/bepascal/source/bepascal/cpp/src/be/storage/Resources.cpp new file mode 100644 index 0000000..3741289 --- /dev/null +++ b/bepascal/source/bepascal/cpp/src/be/storage/Resources.cpp @@ -0,0 +1,401 @@ +/* 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 +*/ + +#ifndef _RESSOURCE_CPP_ +#define _RESSOURCE_CPP_ + +/*********************************************************************** + * AUTHOR: + * FILE: Entry.cpp + * DATE: Wed Jul 2 22:28:34 2003 + * DESCR: + ***********************************************************************/ +#include "Resources.h" +#include + + + +class BPResources : public BResources, public virtual BPasObject { +public: + BPResources(TPasObject PasObject); + BPResources(TPasObject PasObject, const BFile *file, bool truncate = false); + + virtual ~BPResources(); +}; + +BPResources::BPResources(TPasObject PasObject) + :BResources(), + BPasObject(PasObject) +{ +} +BPResources::BPResources(TPasObject PasObject, const BFile *file, bool truncate = false) + :BResources(file,truncate), + BPasObject(PasObject) +{ +} + +BPResources::~BPResources() +{ +} + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Resources.cpp + * DATE: Sun Oct 12 19:52:51 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BResources::BResources + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BResources_Create(TPasObject PasObject) +{ + return new BPResources(PasObject); +} + + +/*********************************************************************** + * Method: BResources::BResources + * Params: const BFile *file, bool truncate + * Effects: + ***********************************************************************/ +TCPlusObject BResources_Create_1 +(TPasObject PasObject, const BFile *file, bool truncate) +{ + return new BPResources(PasObject, file, truncate); +} + + +/*********************************************************************** + * Method: BResources::~BResources + * Params: + * Effects: + ***********************************************************************/ +void BResources_Free(BResources *Resources) +{ + delete Resources; +} + + +/*********************************************************************** + * Method: BResources::SetTo + * Params: const BFile *file, bool truncate + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_SetTo(BResources *Resources, const BFile *file, bool truncate) +{ + return Resources->SetTo(file, truncate); +} + + +/*********************************************************************** + * Method: BResources::File + * Params: + * Returns: const BFile & + * Effects: + ***********************************************************************/ +const BFile & +BResources_File(BResources *Resources) +{ + return Resources->File(); +} + + +/*********************************************************************** + * Method: BResources::LoadResource + * Params: type_code type, int32 id, size_t *out_size + * Returns: const void * + * Effects: + ***********************************************************************/ +const void * +BResources_LoadResource(BResources *Resources, type_code type, int32 id, size_t *out_size) +{ + return Resources->LoadResource(type, id, out_size); +} + + +/*********************************************************************** + * Method: BResources::LoadResource + * Params: type_code type, const char *name, size_t *out_size + * Returns: const void * + * Effects: + ***********************************************************************/ +const void * +BResources_LoadResource_1 +(BResources *Resources, type_code type, const char *name, size_t *out_size) +{ + return Resources->LoadResource(type, name, out_size); +} + + +/*********************************************************************** + * Method: BResources::PreloadResourceType + * Params: type_code type + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_PreloadResourceType(BResources *Resources, type_code type) +{ + return Resources->PreloadResourceType(type); +} + + +/*********************************************************************** + * Method: BResources::Sync + * Params: + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_Sync(BResources *Resources) +{ + return Resources->Sync(); +} + + +/*********************************************************************** + * Method: BResources::MergeFrom + * Params: BFile *from_file + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_MergeFrom(BResources *Resources, BFile *from_file) +{ + return Resources->MergeFrom(from_file); +} + + +/*********************************************************************** + * Method: BResources::WriteTo + * Params: BFile *new_file + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_WriteTo(BResources *Resources, BFile *new_file) +{ + return Resources->WriteTo(new_file); +} + + +/*********************************************************************** + * Method: BResources::AddResource + * Params: type_code type, int32 id, const void *data, size_t data_size, const char *name + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_AddResource(BResources *Resources, type_code type, int32 id, const void *data, size_t data_size, const char *name) +{ + return Resources->AddResource(type, id, data, data_size, name); +} + + +/*********************************************************************** + * Method: BResources::HasResource + * Params: type_code type, int32 id + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BResources_HasResource(BResources *Resources, type_code type, int32 id) +{ + return Resources->HasResource(type, id); +} + + +/*********************************************************************** + * Method: BResources::HasResource + * Params: type_code type, const char *name + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BResources_HasResource_1 +(BResources *Resources, type_code type, const char *name) +{ + return Resources->HasResource(type, name); +} + + +/*********************************************************************** + * Method: BResources::GetResourceInfo + * Params: int32 resIndex, type_code *typeFound, int32 *idFound, const char **nameFound, size_t *size + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BResources_GetResourceInfo(BResources *Resources, int32 resIndex, type_code *typeFound, int32 *idFound, const char **nameFound, size_t *size) +{ + return Resources->GetResourceInfo(resIndex, typeFound, idFound, nameFound, size); +} + + +/*********************************************************************** + * Method: BResources::GetResourceInfo + * Params: type_code type, int32 resIndex, int32 *idFound, const char **nameFound, size_t *size + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BResources_GetResourceInfo_1 +(BResources *Resources, type_code type, int32 resIndex, int32 *idFound, const char **nameFound, size_t *size) +{ + return Resources->GetResourceInfo(type, resIndex, idFound, nameFound, size); +} + + +/*********************************************************************** + * Method: BResources::GetResourceInfo + * Params: type_code type, int32 id, const char **nameFound, size_t *size + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BResources_GetResourceInfo_2 +(BResources *Resources, type_code type, int32 id, const char **nameFound, size_t *size) +{ + return Resources->GetResourceInfo(type, id, nameFound, size); +} + + +/*********************************************************************** + * Method: BResources::GetResourceInfo + * Params: type_code type, const char *name, int32 *idFound, size_t *size + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BResources_GetResourceInfo_3 +(BResources *Resources, type_code type, const char *name, int32 *idFound, size_t *size) +{ + return Resources->GetResourceInfo(type, name, idFound, size); +} + + +/*********************************************************************** + * Method: BResources::GetResourceInfo + * Params: const void *resource, type_code *out_type, int32 *out_id, size_t *out_size, const char **out_name + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BResources_GetResourceInfo_4 +(BResources *Resources, const void *resource, type_code *out_type, int32 *out_id, size_t *out_size, const char **out_name) +{ + return Resources->GetResourceInfo(resource, out_type, out_id, out_size, out_name); +} + + +/*********************************************************************** + * Method: BResources::RemoveResource + * Params: const void *resource + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_RemoveResource(BResources *Resources, const void *resource) +{ + return Resources->RemoveResource(resource); +} + + +/*********************************************************************** + * Method: BResources::RemoveResource + * Params: type_code type, int32 id + * Returns: int + * Effects: + ***********************************************************************/ +int +BResources_RemoveResource_1 +(BResources *Resources, type_code type, int32 id) +{ + return Resources->RemoveResource(type, id); +} + + +/*********************************************************************** + * Method: BResources::WriteResource + * Params: type_code type, int32 id, const void *data, off_t offset, size_t data_size + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_WriteResource(BResources *Resources, type_code type, int32 id, const void *data, off_t offset, size_t data_size) +{ + return Resources->WriteResource(type, id, data, offset, data_size); +} + + +/*********************************************************************** + * Method: BResources::ReadResource + * Params: type_code type, int32 id, void *data, off_t offset, size_t data_size + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BResources_ReadResource(BResources *Resources, type_code type, int32 id, void *data, off_t offset, size_t data_size) +{ + return Resources->ReadResource(type, id, data, offset, data_size); +} + + +/*********************************************************************** + * Method: BResources::FindResource + * Params: type_code type, int32 id, size_t *data_size + * Returns: void * + * Effects: + ***********************************************************************/ +void * +BResources_FindResource(BResources *Resources, type_code type, int32 id, size_t *data_size) +{ + Resources->FindResource(type, id, data_size); +} + + +/*********************************************************************** + * Method: BResources::FindResource + * Params: type_code type, const char *name, size_t *data_size + * Returns: void * + * Effects: + ***********************************************************************/ +void * +BResources_FindResource_1 +(BResources *Resources, type_code type, const char *name, size_t *data_size) +{ + Resources->FindResource(type, name, data_size); +} + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _RESSOURCE_CPP_ */