Missing units
This commit is contained in:
98
bepascal/source/bepascal/pas/src/be/app/cursor.pp
Normal file
98
bepascal/source/bepascal/pas/src/be/app/cursor.pp
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{ BePascal - A pascal wrapper around the BeOS API
|
||||||
|
Copyright (C) 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 cursor;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
BeObj, Archivable, GraphicDefs, Message, OS, Rect, SupportDefs,dataio;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
BCursor = class(BArchivable)
|
||||||
|
private
|
||||||
|
public
|
||||||
|
|
||||||
|
constructor Create(cursorData : pointer );
|
||||||
|
constructor Create(data : BMessage);
|
||||||
|
|
||||||
|
destructor Destroy; override;
|
||||||
|
|
||||||
|
function Instantiate(data : BMessage) : BArchivable;
|
||||||
|
function Archive(data : BMessage; deep : boolean) : Status_t;
|
||||||
|
|
||||||
|
function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BCursor_Create(AObject : TCPlusObject;cursorData : pointer) : TCPlusObject; cdecl; external BePascalLibName name 'BCursor_Create';
|
||||||
|
function BCursor_Create(AObject : TCPlusObject;data : BMessage) : TCPlusObject; cdecl; external BePascalLibName name 'BCursor_Create_1';
|
||||||
|
|
||||||
|
|
||||||
|
procedure BCursor_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BCursor_Free';
|
||||||
|
function BCursor_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BCursor_Instantiate';
|
||||||
|
function BCursor_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BCursor_Archive';
|
||||||
|
function BCursor_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BCursor_Perform';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
constructor BCursor.Create(cursorData : pointer);
|
||||||
|
begin
|
||||||
|
CreatePas;
|
||||||
|
CPlusObject := BCursor_Create(Self,cursorData);
|
||||||
|
end;
|
||||||
|
constructor BCursor.Create(data : BMessage);
|
||||||
|
begin
|
||||||
|
CreatePas;
|
||||||
|
CPlusObject :=BCursor_Create(Self,data);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
destructor BCursor.Destroy;
|
||||||
|
begin
|
||||||
|
BCursor_Free(CPlusObject);
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BCursor.Instantiate(data :BMessage) : BArchivable;
|
||||||
|
begin
|
||||||
|
Result := BCursor_Instantiate(CPlusObject, data.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BCursor.Archive(data : BMessage; deep : boolean) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BCursor_Archive(CPlusObject, data.CPlusObject, deep);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function BCursor.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BCursor_Perform(CPlusObject, d, arg);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
||||||
@@ -70,12 +70,12 @@ type
|
|||||||
cs : color_space);
|
cs : color_space);
|
||||||
function GetOverlayRestrictions(restrict : overlay_restrictions)
|
function GetOverlayRestrictions(restrict : overlay_restrictions)
|
||||||
: status_t;
|
: status_t;
|
||||||
procedure AddChild(view : BView);
|
// procedure AddChild(view : BView);
|
||||||
function RemoveChild(view : BView) : Boolean;
|
// function RemoveChild(view : BView) : Boolean;
|
||||||
function CountChildren : Integer;
|
function CountChildren : Integer;
|
||||||
function ChildAt(index : Integer) : BView;
|
// function ChildAt(index : Integer) : BView;
|
||||||
function FindView(view_name : PChar) : BView;
|
// function FindView(view_name : PChar) : BView;
|
||||||
function FindView(point : BPoint) : BView;
|
// function FindView(point : BPoint) : BView;
|
||||||
function Lock : Boolean;
|
function Lock : Boolean;
|
||||||
procedure Unlock;
|
procedure Unlock;
|
||||||
function IsLocked : Boolean;
|
function IsLocked : Boolean;
|
||||||
@@ -161,7 +161,7 @@ function BBitmap_Bits(AObject : TCPlusObject) : Pointer; cdecl;
|
|||||||
external BePascalLibName name 'BBitmap_Bits';
|
external BePascalLibName name 'BBitmap_Bits';
|
||||||
|
|
||||||
function BBitmap_BitsLength(AObject : TCPlusObject) : integer; cdecl;
|
function BBitmap_BitsLength(AObject : TCPlusObject) : integer; cdecl;
|
||||||
external BePascalLibName name 'BBitmap_BitsLength_1';
|
external BePascalLibName name 'BBitmap_BitsLength';
|
||||||
|
|
||||||
function BBitmap_BytesPerRow(AObject : TCPlusObject) : integer; cdecl;
|
function BBitmap_BytesPerRow(AObject : TCPlusObject) : integer; cdecl;
|
||||||
external BePascalLibName name 'BBitmap_BytesPerRow';
|
external BePascalLibName name 'BBitmap_BytesPerRow';
|
||||||
@@ -189,7 +189,7 @@ function BBitmap_RemoveChild(AObject : TCPlusObject; view : TCPlusObject)
|
|||||||
function BBitmap_CountChildren(AObject : TCPlusObject) : Integer; cdecl;
|
function BBitmap_CountChildren(AObject : TCPlusObject) : Integer; cdecl;
|
||||||
external BePascalLibName name 'BBitmap_CountChildren';
|
external BePascalLibName name 'BBitmap_CountChildren';
|
||||||
|
|
||||||
function BBitmap_ChildAt(AObject : TCPlusObject; index : Integer) : BView;
|
(*function BBitmap_ChildAt(AObject : TCPlusObject; index : Integer) : BView;
|
||||||
cdecl; external BePascalLibName name 'BBitmap_ChildAt';
|
cdecl; external BePascalLibName name 'BBitmap_ChildAt';
|
||||||
|
|
||||||
function BBitmap_FindView(AObject : TCPlusObject; view_name : PChar) : BView;
|
function BBitmap_FindView(AObject : TCPlusObject; view_name : PChar) : BView;
|
||||||
@@ -197,7 +197,7 @@ function BBitmap_FindView(AObject : TCPlusObject; view_name : PChar) : BView;
|
|||||||
|
|
||||||
function BBitmap_FindView(AObject : TCPlusObject; point : {BPoint}TCPlusObject)
|
function BBitmap_FindView(AObject : TCPlusObject; point : {BPoint}TCPlusObject)
|
||||||
: BView; cdecl; external BePascalLibName name 'BBitmap_FindView';
|
: BView; cdecl; external BePascalLibName name 'BBitmap_FindView';
|
||||||
|
*)
|
||||||
function BBitmap_Lock(AObject : TCPlusObject) : Boolean; cdecl;
|
function BBitmap_Lock(AObject : TCPlusObject) : Boolean; cdecl;
|
||||||
external BePascalLibName name 'BBitmap_Lock';
|
external BePascalLibName name 'BBitmap_Lock';
|
||||||
|
|
||||||
@@ -361,7 +361,7 @@ begin
|
|||||||
Result := BBitmap_GetOverlayRestrictions(CPlusObject, restrict);
|
Result := BBitmap_GetOverlayRestrictions(CPlusObject, restrict);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure BBitmap.AddChild(view : BView);
|
(*procedure BBitmap.AddChild(view : BView);
|
||||||
begin
|
begin
|
||||||
BBitmap_AddChild(CPlusObject, view.CPlusObject);
|
BBitmap_AddChild(CPlusObject, view.CPlusObject);
|
||||||
end;
|
end;
|
||||||
@@ -370,13 +370,14 @@ function BBitmap.RemoveChild(view : BView) : Boolean;
|
|||||||
begin
|
begin
|
||||||
Result := BBitmap_RemoveChild(CPlusObject, view.CPlusObject);
|
Result := BBitmap_RemoveChild(CPlusObject, view.CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
*)
|
||||||
|
|
||||||
function BBitmap.CountChildren : Integer;
|
function BBitmap.CountChildren : Integer;
|
||||||
begin
|
begin
|
||||||
Result := BBitmap_CountChildren(CPlusObject);
|
Result := BBitmap_CountChildren(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BBitmap.ChildAt(index : Integer) : BView;
|
(*function BBitmap.ChildAt(index : Integer) : BView;
|
||||||
begin
|
begin
|
||||||
Result := BBitmap_ChildAt(CPlusObject, index);
|
Result := BBitmap_ChildAt(CPlusObject, index);
|
||||||
end;
|
end;
|
||||||
@@ -390,6 +391,7 @@ function BBitmap.FindView(point : BPoint) : BView;
|
|||||||
begin
|
begin
|
||||||
Result := BBitmap_FindView(CPlusObject, point.CPlusObject);
|
Result := BBitmap_FindView(CPlusObject, point.CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
*)
|
||||||
|
|
||||||
function BBitmap.Lock : Boolean;
|
function BBitmap.Lock : Boolean;
|
||||||
begin
|
begin
|
||||||
|
|||||||
227
bepascal/source/bepascal/pas/src/be/interface/region.pp
Normal file
227
bepascal/source/bepascal/pas/src/be/interface/region.pp
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
{ 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 region;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
beobj,rect;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
type clipping_rect=record
|
||||||
|
left :integer;
|
||||||
|
top:integer;
|
||||||
|
right:integer;
|
||||||
|
bottom:integer;
|
||||||
|
end;
|
||||||
|
|
||||||
|
type
|
||||||
|
BRegion = class(TBeObject)
|
||||||
|
private
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
constructor Create(region :BRegion );
|
||||||
|
constructor Create(rect : Brect);
|
||||||
|
destructor Destroy;override;
|
||||||
|
function Frame : BRect;
|
||||||
|
function FrameInt : clipping_rect;
|
||||||
|
function RectAt(index : integer) : BRect;
|
||||||
|
function RectAtInt(index : integer) :clipping_rect ;
|
||||||
|
function CountRects : integer;
|
||||||
|
procedure SetRect(newBounds : BRect);
|
||||||
|
procedure Setclipping_rect(newBounds : clipping_rect);
|
||||||
|
function Intersects(r : BRect) : boolean;
|
||||||
|
function Intersects(r : clipping_rect) : boolean;
|
||||||
|
function Contains(pt : BPoint) : boolean;
|
||||||
|
function Contains(x : integer; y : integer) : boolean;
|
||||||
|
procedure PrintToStream;
|
||||||
|
procedure OffsetBy(dh : integer; dv : integer);
|
||||||
|
procedure MakeEmpty;
|
||||||
|
procedure Include(r : BRect);
|
||||||
|
procedure Include(r : clipping_rect);
|
||||||
|
procedure Include( r: BRegion);
|
||||||
|
procedure Exclude(r : BRect);
|
||||||
|
procedure Exclude(r : clipping_rect);
|
||||||
|
procedure Exclude(r : BRegion);
|
||||||
|
procedure IntersectWith(r : BRegion);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion_Create(AObject : TBeObject): TCPlusObject; cdecl; external BePascalLibName name 'BRegion_Create';
|
||||||
|
function BRegion_Create(AObject : TBeObject; region : BRegion): TCPlusObject; cdecl; external BePascalLibName name 'BRegion_Create';
|
||||||
|
function BRegion_Create(AObject : TBeObject; rect : Brect): TCPlusObject; cdecl; external BePascalLibName name 'BRegion_Create';
|
||||||
|
procedure BRegion_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRegion_Free';
|
||||||
|
function BRegion_Frame(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BRegion_Frame';
|
||||||
|
function BRegion_FrameInt(AObject : TCPlusObject) :clipping_rect ; cdecl; external BePascalLibName name 'BRegion_FrameInt_1';
|
||||||
|
function BRegion_RectAt(AObject : TCPlusObject; index : integer) : BRect; cdecl; external BePascalLibName name 'BRegion_RectAt';
|
||||||
|
function BRegion_RectAtInt(AObject : TCPlusObject; index : integer) : clipping_rect; cdecl; external BePascalLibName name 'BRegion_RectAtInt_1';
|
||||||
|
function BRegion_CountRects(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BRegion_CountRects';
|
||||||
|
procedure BRegion_Set(AObject : TCPlusObject; newBounds : TCPlusObject); cdecl; external BePascalLibName name 'BRegion_Set';
|
||||||
|
procedure BRegion_Set(AObject : TCPlusObject; newBounds : clipping_rect); cdecl; external BePascalLibName name 'BRegion_Set';
|
||||||
|
function BRegion_Intersects(AObject : TCPlusObject; r : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BRegion_Intersects';
|
||||||
|
function BRegion_Intersects(AObject : TCPlusObject; r : clipping_rect) : boolean; cdecl; external BePascalLibName name 'BRegion_Intersects';
|
||||||
|
function BRegion_Contains(AObject : TCPlusObject; pt : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BRegion_Contains';
|
||||||
|
function BRegion_Contains(AObject : TCPlusObject; x : integer; y : integer) : boolean; cdecl; external BePascalLibName name 'BRegion_Contains';
|
||||||
|
procedure BRegion_PrintToStream(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRegion_PrintToStream';
|
||||||
|
procedure BRegion_OffsetBy(AObject : TCPlusObject; dh : integer; dv : integer); cdecl; external BePascalLibName name 'BRegion_OffsetBy';
|
||||||
|
procedure BRegion_MakeEmpty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRegion_MakeEmpty';
|
||||||
|
procedure BRegion_Include(AObject : TCPlusObject; r : TCPlusObject); cdecl; external BePascalLibName name 'BRegion_Include';
|
||||||
|
procedure BRegion_Include(AObject : TCPlusObject; r : clipping_rect); cdecl; external BePascalLibName name 'BRegion_Include';
|
||||||
|
procedure BRegion_Include(AObject : TCPlusObject; r : BRegion); cdecl; external BePascalLibName name 'BRegion_Include';
|
||||||
|
procedure BRegion_Exclude(AObject : TCPlusObject; r : TCPlusObject); cdecl; external BePascalLibName name 'BRegion_Exclude';
|
||||||
|
procedure BRegion_Exclude(AObject : TCPlusObject; r :clipping_rect ); cdecl; external BePascalLibName name 'BRegion_Exclude';
|
||||||
|
procedure BRegion_Exclude(AObject : TCPlusObject; r: BRegion); cdecl; external BePascalLibName name 'BRegion_Exclude';
|
||||||
|
procedure BRegion_IntersectWith(AObject : TCPlusObject; r: BRegion); cdecl; external BePascalLibName name 'BRegion_IntersectWith';
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
constructor BRegion.Create;
|
||||||
|
begin
|
||||||
|
CreatePas;
|
||||||
|
CPlusObject := BRegion_Create(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor BRegion.Create(region : BRegion);
|
||||||
|
begin
|
||||||
|
CreatePas;
|
||||||
|
CPlusObject := BRegion_Create(Self, region);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor BRegion.Create(rect : BRect);
|
||||||
|
begin
|
||||||
|
CreatePas;
|
||||||
|
CPlusObject := BRegion_Create(Self, rect);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor BRegion.Destroy;
|
||||||
|
begin
|
||||||
|
BRegion_Free(CPlusObject);
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function BRegion.Frame : BRect;
|
||||||
|
begin
|
||||||
|
Result := BRegion_Frame(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion.FrameInt :clipping_rect ;
|
||||||
|
begin
|
||||||
|
Result := BRegion_FrameInt(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion.RectAt(index : integer) : BRect;
|
||||||
|
begin
|
||||||
|
Result := BRegion_RectAt(CPlusObject, index);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion.RectAtInt(index : integer) :clipping_rect ;
|
||||||
|
begin
|
||||||
|
Result := BRegion_RectAtInt(CPlusObject, index);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion.CountRects : integer;
|
||||||
|
begin
|
||||||
|
Result := BRegion_CountRects(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.Setrect(newBounds : BRect);
|
||||||
|
begin
|
||||||
|
BRegion_Set(CPlusObject, newBounds.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.Setclipping_rect(newBounds : clipping_rect);
|
||||||
|
begin
|
||||||
|
BRegion_Set(CPlusObject, newBounds);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion.Intersects(r : BRect) : boolean;
|
||||||
|
begin
|
||||||
|
Result := BRegion_Intersects(CPlusObject, r.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion.Intersects(r : clipping_rect) : boolean;
|
||||||
|
begin
|
||||||
|
Result := BRegion_Intersects(CPlusObject, r);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion.Contains(pt : BPoint) : boolean;
|
||||||
|
begin
|
||||||
|
Result := BRegion_Contains(CPlusObject, pt.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BRegion.Contains(x : integer; y : integer) : boolean;
|
||||||
|
begin
|
||||||
|
Result := BRegion_Contains(CPlusObject, x, y);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.PrintToStream;
|
||||||
|
begin
|
||||||
|
BRegion_PrintToStream(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.OffsetBy(dh : integer; dv : integer);
|
||||||
|
begin
|
||||||
|
BRegion_OffsetBy(CPlusObject, dh, dv);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.MakeEmpty;
|
||||||
|
begin
|
||||||
|
BRegion_MakeEmpty(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.Include(r : BRect);
|
||||||
|
begin
|
||||||
|
BRegion_Include(CPlusObject, r.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.Include(r : clipping_rect);
|
||||||
|
begin
|
||||||
|
BRegion_Include(CPlusObject, r);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.Include(r : BRegion);
|
||||||
|
begin
|
||||||
|
BRegion_Include(CPlusObject, r);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.Exclude(r : BRect);
|
||||||
|
begin
|
||||||
|
BRegion_Exclude(CPlusObject, r.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.Exclude(r : clipping_rect);
|
||||||
|
begin
|
||||||
|
BRegion_Exclude(CPlusObject, r);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.Exclude( r: BRegion);
|
||||||
|
begin
|
||||||
|
BRegion_Exclude(CPlusObject, r);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BRegion.IntersectWith( r: BRegion);
|
||||||
|
begin
|
||||||
|
BRegion_IntersectWith(CPlusObject, r);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
||||||
198
bepascal/source/bepascal/pas/src/be/interface/shape.pp
Normal file
198
bepascal/source/bepascal/pas/src/be/interface/shape.pp
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
{ 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 shape;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
beobj, message,interfacedefs,SupportDefs,archivable,rect;
|
||||||
|
|
||||||
|
type
|
||||||
|
BShape =Class;
|
||||||
|
|
||||||
|
BShapeIterator = class(TBeObject)
|
||||||
|
private
|
||||||
|
public
|
||||||
|
constructor Create; override;
|
||||||
|
destructor Destroy;override;
|
||||||
|
function IterateMoveTo(point : BPoint) : Status_t;
|
||||||
|
function IterateLineTo(lineCount : integer; linePts : BPoint) : Status_t;
|
||||||
|
function IterateBezierTo(bezierCount : integer; bezierPts : BPoint) : Status_t;
|
||||||
|
function IterateClose : Status_t;
|
||||||
|
function Iterate(shape : BShape) : Status_t;
|
||||||
|
end;
|
||||||
|
type
|
||||||
|
BShape = class(BArchivable)
|
||||||
|
private
|
||||||
|
public
|
||||||
|
constructor Create;override;
|
||||||
|
constructor Create(copyFrom : BShape);
|
||||||
|
constructor Create(data : BMessage);
|
||||||
|
destructor Destroy;override;
|
||||||
|
function Archive(into : BMessage; deep : boolean) : Status_t;
|
||||||
|
function Instantiate(data : BMessage) : BArchivable;
|
||||||
|
procedure Clear;
|
||||||
|
function Bounds : BRect;
|
||||||
|
function AddShape(other : BShape) : Status_t;
|
||||||
|
function MoveTo(point : BPoint) : Status_t;
|
||||||
|
function LineTo(linePoint : BPoint) : Status_t;
|
||||||
|
function BezierTo(controlPoints : BPoint) : Status_t;
|
||||||
|
function Close : Status_t;
|
||||||
|
// function Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShapeIterator_Create(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BShapeIterator_Create';
|
||||||
|
procedure BShapeIterator_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BShapeIterator_Free';
|
||||||
|
function BShapeIterator_IterateMoveTo(AObject : TCPlusObject; point : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShapeIterator_IterateMoveTo';
|
||||||
|
function BShapeIterator_IterateLineTo(AObject : TCPlusObject; lineCount : integer; linePts : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShapeIterator_IterateLineTo';
|
||||||
|
function BShapeIterator_IterateBezierTo(AObject : TCPlusObject; bezierCount : integer; bezierPts : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShapeIterator_IterateBezierTo';
|
||||||
|
function BShapeIterator_IterateClose(AObject : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShapeIterator_IterateClose';
|
||||||
|
function BShapeIterator_Iterate(AObject : TCPlusObject; shape : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShapeIterator_Iterate';
|
||||||
|
|
||||||
|
function BShape_Create(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BShape_Create';
|
||||||
|
function BShape_Create(AObject : TBeObject; copyFrom : BShape):TCPlusObject; cdecl; external BePascalLibName name 'BShape_Create_1';
|
||||||
|
function BShape_Create(AObject : TBeObject; data : TCPlusObject):TCPlusObject; cdecl; external BePascalLibName name 'BShape_Create_2';
|
||||||
|
procedure BShape_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BShape_Free';
|
||||||
|
function BShape_Archive(AObject : TCPlusObject; into : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BShape_Archive';
|
||||||
|
function BShape_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BShape_Instantiate';
|
||||||
|
procedure BShape_Clear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BShape_Clear';
|
||||||
|
function BShape_Bounds(AObject : TCPlusObject) : BRect; cdecl; external BePascalLibName name 'BShape_Bounds';
|
||||||
|
function BShape_AddShape(AObject : TCPlusObject; other : BShape) : Status_t; cdecl; external BePascalLibName name 'BShape_AddShape';
|
||||||
|
function BShape_MoveTo(AObject : TCPlusObject; point : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShape_MoveTo';
|
||||||
|
function BShape_LineTo(AObject : TCPlusObject; linePoint : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShape_LineTo';
|
||||||
|
function BShape_BezierTo(AObject : TCPlusObject; controlPoints : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShape_BezierTo';
|
||||||
|
function BShape_Close(AObject : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BShape_Close';
|
||||||
|
//function BShape_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BShape_Perform';
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
constructor BShapeIterator.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
CPlusObject := BShapeIterator_Create(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor BShapeIterator.Destroy;
|
||||||
|
begin
|
||||||
|
BShapeIterator_Free(CPlusObject);
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShapeIterator.IterateMoveTo(point : BPoint) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShapeIterator_IterateMoveTo(CPlusObject, point.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShapeIterator.IterateLineTo(lineCount : integer; linePts : BPoint) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShapeIterator_IterateLineTo(CPlusObject, lineCount, linePts.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShapeIterator.IterateBezierTo(bezierCount : integer; bezierPts : BPoint) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShapeIterator_IterateBezierTo(CPlusObject, bezierCount, bezierPts.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShapeIterator.IterateClose : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShapeIterator_IterateClose(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShapeIterator.Iterate(shape : BShape) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShapeIterator_Iterate(CPlusObject, shape.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
constructor BShape.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
CPlusObject := BShape_Create(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor BShape.Create(copyFrom : BShape);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
CPlusObject := BShape_Create(Self, copyFrom);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor BShape.Create(data : BMessage);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
CPlusObject := BShape_Create(Self, data.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor BShape.Destroy;
|
||||||
|
begin
|
||||||
|
BShape_Free(CPlusObject);
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShape.Archive(into : BMessage; deep : boolean) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShape_Archive(CPlusObject, into.CPlusObject, deep);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShape.Instantiate(data : BMessage) : BArchivable;
|
||||||
|
begin
|
||||||
|
Result := BShape_Instantiate(CPlusObject, data.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure BShape.Clear;
|
||||||
|
begin
|
||||||
|
BShape_Clear(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShape.Bounds : BRect;
|
||||||
|
begin
|
||||||
|
Result := BShape_Bounds(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShape.AddShape(other : BShape) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShape_AddShape(CPlusObject, other);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShape.MoveTo(point : BPoint) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShape_MoveTo(CPlusObject, point.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShape.LineTo(linePoint : BPoint) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShape_LineTo(CPlusObject, linePoint.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShape.BezierTo(controlPoints : BPoint) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShape_BezierTo(CPlusObject, controlPoints.CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function BShape.Close : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShape_Close(CPlusObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{function BShape.Perform(d : Perform_code; arg : Pointer) : Status_t;
|
||||||
|
begin
|
||||||
|
Result := BShape_Perform(CPlusObject, d, arg);
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
|
end.
|
||||||
Reference in New Issue
Block a user