minor corrections to latest CVS merge and other misc changes.

This commit is contained in:
oscarl-2
2003-12-20 20:16:45 +00:00
parent 3641054ca6
commit 44a8d13868
5 changed files with 658 additions and 669 deletions

View File

@@ -22,87 +22,123 @@ unit Alert;
interface interface
uses uses
BeObj, Archivable, Button, InterfaceDefs, Invoker, Handler, BeObj, Archivable, Button, InterfaceDefs, Invoker, Handler, Message, Rect,
Message, Rect, SupportDefs, TextView, Window; SupportDefs, TextView, Window;
type type
{ enum for flavors of alert } alert_type = (
// enum alert_type B_EMPTY_ALERT,
Alert_Type = (B_EMPTY_ALERT, B_INFO_ALERT, B_IDEA_ALERT, B_WARNING_ALERT, B_INFO_ALERT,
B_STOP_ALERT); B_IDEA_ALERT,
B_WARNING_ALERT,
B_STOP_ALERT
);
//enum button_spacing button_spacing = (B_EVEN_SPACING, B_OFFSET_SPACING);
Button_Spacing = (B_EVEN_SPACING, B_OFFSET_SPACING);
BAlert = class(BWindow) BAlert = class(BWindow)
private private
public public
// Here we have this name colition: type --> kind
constructor Create(title : PChar; text : PChar; button1 : PChar; constructor Create(title : PChar; text : PChar; button1 : PChar;
button2 : PChar; button3 : PChar; width : Button_Width; button2 : PChar {$ifndef VER1_0}= nil{$endif};
kind{type} : Alert_Type); button3 : PChar {$ifndef VER1_0}= nil{$endif};
width : button_width {$ifndef VER1_0}= B_WIDTH_AS_USUAL{$endif};
type_ : alert_type {$ifndef VER1_0}= B_INFO_ALERT{$endif});
constructor Create(title : PChar; text : PChar; button1 : PChar; constructor Create(title : PChar; text : PChar; button1 : PChar;
button2 : PChar; button3 : PChar; width : Button_Width; button2 : PChar; button3 : PChar; width : button_width;
spacing : Button_Spacing; kind{type} : Alert_Type); spacing : button_spacing;
type_ : alert_type {$ifndef VER1_0}= B_INFO_ALERT{$endif});
constructor Create(data : BMessage); constructor Create(data : BMessage);
destructor Destroy; override; destructor Destroy; override;
function Instantiate(data : BMessage) : BArchivable; function Instantiate(data : BMessage) : BArchivable;
function Archive(data : BMessage; deep : boolean) : Status_t; function Archive(data : BMessage; deep : Boolean {$ifndef VER1_0}= true{$endif}) : status_t;
procedure SetShortcut(button_index : integer; key : Char); procedure SetShortcut(button_index : Longint; key : Char);
function Shortcut(button_index : integer) : Char; function Shortcut(button_index : Longint) : Char;
function Go : integer; function Go : Longint;
function Go(invoker : BInvoker) : Status_t; function Go(invoker : BInvoker) : status_t;
procedure MessageReceived(an_event : BMessage); override; procedure MessageReceived(an_event : BMessage); override;
procedure FrameResized(new_width : double; new_height : double); procedure FrameResized(new_width, new_height : Single);
function ButtonAt(index : integer) : BButton; function ButtonAt(index : Longint) : BButton;
function TextView : BTextView; function TextView : BTextView;
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; function ResolveSpecifier(msg : BMessage; index : Longint; specifier : BMessage; form : Longint; properti : PChar) : BHandler;
function GetSupportedSuites(data : BMessage) : Status_t; function GetSupportedSuites(data : BMessage) : status_t;
procedure DispatchMessage(msg : BMessage; handler : BHandler); override; procedure DispatchMessage(msg : BMessage; handler : BHandler); override;
procedure Quit; procedure Quit;
function QuitRequested : boolean; override; function QuitRequested : Boolean; override;
function AlertPosition(width : double; height : double) : BPoint; function AlertPosition(width, height : Single) : BPoint;
end; end;
function BAlert_Create(AObject : TBeObject; title : PChar; text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width;kind{type} : Alert_Type) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create'; function BAlert_Create(AObject : TBeObject; title : PChar; text : PChar;
function BAlert_Create_1(AObject : TBeObject; title : PChar; text : PChar;button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width; spacing : Button_Spacing; kind{type} : Alert_Type) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create_1'; button1 : PChar; button2 : PChar; button3 : PChar;
function BAlert_Create_2(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create_2'; width : Button_Width; kind{type} : alert_type)
: TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create';
procedure BAlert_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_Free'; function BAlert_Create_1(AObject : TBeObject; title : PChar; text : PChar;
button1 : PChar; button2 : PChar; button3 : PChar;
width : button_width; spacing : button_spacing;
kind{type} : Alert_Type) : TCPlusObject;
cdecl; external BePascalLibName name 'BAlert_Create_1';
function BAlert_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BAlert_Instantiate'; function BAlert_Create_2(AObject : TBeObject; data : TCPlusObject) : TCPlusObject;
function BAlert_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BAlert_Archive'; cdecl; external BePascalLibName name 'BAlert_Create_2';
procedure BAlert_SetShortcut(AObject : TCPlusObject; button_index : integer; key : Char); cdecl; external BePascalLibName name 'BAlert_SetShortcut';
function BAlert_Shortcut(AObject : TCPlusObject; button_index : integer) : Char; cdecl; external BePascalLibName name 'BAlert_Shortcut'; procedure BAlert_Free(AObject : TCPlusObject);
function BAlert_Go(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BAlert_Go'; cdecl; external BePascalLibName name 'BAlert_Free';
function BAlert_Go(AObject : TCPlusObject; invoker : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BAlert_Go';
procedure BAlert_MessageReceived(AObject : TCPlusObject; an_event : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_MessageReceived'; function BAlert_Instantiate(AObject : TCPlusObject; data : TCPlusObject)
procedure BAlert_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BAlert_FrameResized'; : BArchivable; cdecl; external BePascalLibName name 'BAlert_Instantiate';
function BAlert_ButtonAt(AObject : TCPlusObject; index : integer) : BButton; cdecl; external BePascalLibName name 'BAlert_ButtonAt'; function BAlert_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean)
function BAlert_TextView(AObject : TCPlusObject) : BTextView; cdecl; external BePascalLibName name 'BAlert_TextView'; : Status_t; cdecl; external BePascalLibName name 'BAlert_Archive';
function BAlert_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BAlert_ResolveSpecifier'; procedure BAlert_SetShortcut(AObject : TCPlusObject; button_index : Longint; key : Char);
function BAlert_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BAlert_GetSupportedSuites'; cdecl; external BePascalLibName name 'BAlert_SetShortcut';
procedure BAlert_DispatchMessage(AObject : TCPlusObject; msg : TCPlusObject; handler : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_DispatchMessage'; function BAlert_Shortcut(AObject : TCPlusObject; button_index : Longint) : Char;
procedure BAlert_Quit(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BAlert_Quit'; cdecl; external BePascalLibName name 'BAlert_Shortcut';
function BAlert_QuitRequested(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BAlert_QuitRequested'; function BAlert_Go(AObject : TCPlusObject) : Longint;
function BAlert_AlertPosition(AObject : TCPlusObject; width : double; height : double) : BPoint; cdecl; external BePascalLibName name 'BAlert_AlertPosition'; cdecl; external BePascalLibName name 'BAlert_Go';
function BAlert_Go(AObject : TCPlusObject; invoker : TCPlusObject) : status_t;
cdecl; external BePascalLibName name 'BAlert_Go';
procedure BAlert_MessageReceived(AObject : TCPlusObject; an_event : TCPlusObject);
cdecl; external BePascalLibName name 'BAlert_MessageReceived';
procedure BAlert_FrameResized(AObject : TCPlusObject; new_width, new_height : Single);
cdecl; external BePascalLibName name 'BAlert_FrameResized';
function BAlert_ButtonAt(AObject : TCPlusObject; index : Longint) : BButton;
cdecl; external BePascalLibName name 'BAlert_ButtonAt';
function BAlert_TextView(AObject : TCPlusObject) : BTextView;
cdecl; external BePascalLibName name 'BAlert_TextView';
function BAlert_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject;
index : Longint; specifier : TCPlusObject;
form : Longint; properti : PChar) : BHandler;
cdecl; external BePascalLibName name 'BAlert_ResolveSpecifier';
function BAlert_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject)
: status_t; cdecl; external BePascalLibName name 'BAlert_GetSupportedSuites';
procedure BAlert_DispatchMessage(AObject : TCPlusObject; msg : TCPlusObject;
handler : TCPlusObject);
cdecl; external BePascalLibName name 'BAlert_DispatchMessage';
procedure BAlert_Quit(AObject : TCPlusObject);
cdecl; external BePascalLibName name 'BAlert_Quit';
function BAlert_QuitRequested(AObject : TCPlusObject) : Boolean;
cdecl; external BePascalLibName name 'BAlert_QuitRequested';
function BAlert_AlertPosition(AObject : TCPlusObject; width, height : Single)
: BPoint; cdecl; external BePascalLibName name 'BAlert_AlertPosition';
implementation implementation
constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar; constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar;
button2 : PChar; button3 : PChar; width : Button_Width; button2 : PChar; button3 : PChar; width : button_width;
kind{type} : Alert_Type); type_ : alert_type);
begin begin
CPlusObject := BAlert_Create(Self, title, text, button1, button2, button3, CPlusObject := BAlert_Create(Self, title, text, button1, button2, button3,
width, kind); width, type_);
end; end;
constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar; button2 : PChar; button3 : PChar; width : Button_Width; spacing : Button_Spacing; kind{type} : Alert_Type); constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar;
button2 : PChar; button3 : PChar; width : button_width;
spacing : button_spacing; type_ : alert_type);
begin begin
CPlusObject := BAlert_Create_1(Self, title, text, button1, button2, button3, CPlusObject := BAlert_Create_1(Self, title, text, button1, button2, button3,
width, spacing, kind{type}); width, spacing, type_);
end; end;
constructor BAlert.Create(data : BMessage); constructor BAlert.Create(data : BMessage);
@@ -120,27 +156,27 @@ begin
Result := BAlert_Instantiate(CPlusObject, data.CPlusObject); Result := BAlert_Instantiate(CPlusObject, data.CPlusObject);
end; end;
function BAlert.Archive(data : BMessage; deep : boolean) : Status_t; function BAlert.Archive(data : BMessage; deep : Boolean) : status_t;
begin begin
Result := BAlert_Archive(CPlusObject, data.CPlusObject, deep); Result := BAlert_Archive(CPlusObject, data.CPlusObject, deep);
end; end;
procedure BAlert.SetShortcut(button_index : integer; key : Char); procedure BAlert.SetShortcut(button_index : Longint; key : Char);
begin begin
BAlert_SetShortcut(CPlusObject, button_index, key); BAlert_SetShortcut(CPlusObject, button_index, key);
end; end;
function BAlert.Shortcut(button_index : integer) : Char; function BAlert.Shortcut(button_index : Longint) : Char;
begin begin
Result := BAlert_Shortcut(CPlusObject, button_index); Result := BAlert_Shortcut(CPlusObject, button_index);
end; end;
function BAlert.Go : integer; function BAlert.Go : Longint;
begin begin
Result := BAlert_Go(CPlusObject); Result := BAlert_Go(CPlusObject);
end; end;
function BAlert.Go(invoker : BInvoker) : Status_t; function BAlert.Go(invoker : BInvoker) : status_t;
begin begin
Result := BAlert_Go(CPlusObject, invoker.CPlusObject); Result := BAlert_Go(CPlusObject, invoker.CPlusObject);
end; end;
@@ -150,12 +186,12 @@ begin
BAlert_MessageReceived(CPlusObject, an_event.CPlusObject); BAlert_MessageReceived(CPlusObject, an_event.CPlusObject);
end; end;
procedure BAlert.FrameResized(new_width : double; new_height : double); procedure BAlert.FrameResized(new_width, new_height : Single);
begin begin
BAlert_FrameResized(CPlusObject, new_width, new_height); BAlert_FrameResized(CPlusObject, new_width, new_height);
end; end;
function BAlert.ButtonAt(index : integer) : BButton; function BAlert.ButtonAt(index : Longint) : BButton;
begin begin
Result := BAlert_ButtonAt(CPlusObject, index); Result := BAlert_ButtonAt(CPlusObject, index);
end; end;
@@ -165,12 +201,12 @@ begin
Result := BAlert_TextView(CPlusObject); Result := BAlert_TextView(CPlusObject);
end; end;
function BAlert.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; function BAlert.ResolveSpecifier(msg : BMessage; index : Longint; specifier : BMessage; form : Longint; properti : PChar) : BHandler;
begin begin
Result := BAlert_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); Result := BAlert_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
end; end;
function BAlert.GetSupportedSuites(data : BMessage) : Status_t; function BAlert.GetSupportedSuites(data : BMessage) : status_t;
begin begin
Result := BAlert_GetSupportedSuites(CPlusObject, data.CPlusObject); Result := BAlert_GetSupportedSuites(CPlusObject, data.CPlusObject);
end; end;
@@ -185,15 +221,14 @@ begin
BAlert_Quit(CPlusObject); BAlert_Quit(CPlusObject);
end; end;
function BAlert.QuitRequested : boolean; function BAlert.QuitRequested : Boolean;
begin begin
Result := BAlert_QuitRequested(CPlusObject); Result := BAlert_QuitRequested(CPlusObject);
end; end;
function BAlert.AlertPosition(width : double; height : double) : BPoint; function BAlert.AlertPosition(width : Single; height : Single) : BPoint;
begin begin
Result := BAlert_AlertPosition(CPlusObject, width, height); Result := BAlert_AlertPosition(CPlusObject, width, height);
end; end;
end. end.

View File

@@ -20,22 +20,6 @@
} }
unit GraphicDefs; unit GraphicDefs;
{
(Manual) Translation of Be's GraphicDefs.h
Ok, if TBitmap doesn't work, the error its most likely to be in this unit.
What this unit needs? that someone take a look at the points marked with:
// Check/Confirm This one, please.
I'm not too sure about how to translate the enums, and also not sure about
the values of the index on a set. Excuse (and fix!) my ignorace :)
Maybe I also screwed up a little the integer types too, be warned :^P
-- BiPolar.
}
interface interface
uses uses
@@ -43,109 +27,87 @@ uses
{$PACKRECORDS C} {$PACKRECORDS C}
type type
// This one must be find a better place. // This one must be find a better place.
PCardinal = ^Cardinal; PCardinal = ^Cardinal;
PLongword = ^Longword;
(*----------------------------------------------------------------*) (*----------------------------------------------------------------*)
type type
{ TPattern = pattern } pattern = record
Pattern = record data : array [0..7] of Byte;
Data : array [0..7] of Byte; // uint8
end; end;
// How we do 'export' these global const? var
// Check/Confirm This one, please. B_SOLID_HIGH : pattern; cvar; external;
B_MIXED_COLORS : pattern; cvar; external;
var {const} B_SOLID_LOW : pattern; cvar; external;
B_SOLID_HIGH : Pattern; cvar; external;
B_MIXED_COLORS : Pattern; cvar; external;
B_SOLID_LOW : Pattern; cvar; external;
(*----------------------------------------------------------------*) (*----------------------------------------------------------------*)
type type
{ I do prefer TRGBColor but... oh well... } rgb_Color = record
RGB_Color = record red,
Red, green,
Green, blue,
Blue, alpha : Byte;
Alpha : Byte;
end; end;
(*----------------------------------------------------------------*) (*----------------------------------------------------------------*)
var var
{const} B_TRANSPARENT_COLOR : rgb_color; cvar; external;
//extern const rgb_color B_TRANSPARENT_COLOR;
B_TRANSPARENT_COLOR : RGB_Color; cvar; external;
//extern const uint8 B_TRANSPARENT_MAGIC_CMAP8;
B_TRANSPARENT_MAGIC_CMAP8 : Byte; cvar; external; B_TRANSPARENT_MAGIC_CMAP8 : Byte; cvar; external;
//extern const uint16 B_TRANSPARENT_MAGIC_RGBA15;
B_TRANSPARENT_MAGIC_RGBA15 : Word; cvar; external; B_TRANSPARENT_MAGIC_RGBA15 : Word; cvar; external;
//extern const uint16 B_TRANSPARENT_MAGIC_RGBA15_BIG;
B_TRANSPARENT_MAGIC_RGBA15_BIG : Word; cvar; external; B_TRANSPARENT_MAGIC_RGBA15_BIG : Word; cvar; external;
//extern const uint32 B_TRANSPARENT_MAGIC_RGBA32;
B_TRANSPARENT_MAGIC_RGBA32 : Cardinal; cvar; external; B_TRANSPARENT_MAGIC_RGBA32 : Cardinal; cvar; external;
//extern const uint32 B_TRANSPARENT_MAGIC_RGBA32_BIG;
B_TRANSPARENT_MAGIC_RGBA32_BIG : Cardinal; cvar; external; B_TRANSPARENT_MAGIC_RGBA32_BIG : Cardinal; cvar; external;
//extern const uint8 B_TRANSPARENT_8_BIT;
B_TRANSPARENT_8_BIT : Byte; cvar; external; B_TRANSPARENT_8_BIT : Byte; cvar; external;
//extern const rgb_color B_TRANSPARENT_32_BIT; B_TRANSPARENT_32_BIT : rgb_color; cvar; external;
B_TRANSPARENT_32_BIT : RGB_Color; cvar; external;
(*----------------------------------------------------------------*) (*----------------------------------------------------------------*)
type type
color_map = record
Color_Map = record id : Longint;
ID : Integer; // int32 color_list: array [0..255] of rgb_color;
ColorList: array [0..255] of RGB_Color; inversion_map : array [0..255] of Byte;
InversionMap : array [0..255] of Byte; // uint8 index_map : array [0..32767] of Byte;
IndexMap : array [0..32767] of Byte; // uint8
end; end;
{ TOverlayRectLimits = overlay_rect_limits } overlay_rect_limits = record
OverlayRectLimits = record horizontal_alignment,
HorizontalAlignment, vertical_alignment,
VerticalAlignment, width_alignment,
WidthAlignment, height_alignment,
HeightAlignment, min_width,
MinWidth, max_width,
MaxWidth, min_height,
MinHeight, max_height : Word;
MaxHeight : Word; // uint16 reserved : array [0..7] of Longword;
Reserved : array [0..7] of Cardinal; // uint32
end; end;
{ TOverlayRestrictions = overlay_restrictions } overlay_restrictions = record
OverlayRestrictions = record source,
Source, destination : overlay_rect_limits;
Destination : OverlayRectLimits; min_width_scale,
MinWidthScale, max_width_scale,
MaxWidthScale, min_height_scale,
MinHeightScale, max_height_scale : Single;
MaxHeightScale : Double; // float reserved : array [0..7] of Longword;
Reserved : array [0..7] of Cardinal; // uint32
end; end;
(*----------------------------------------------------------------*) (*----------------------------------------------------------------*)
screen_id = record
//struct screen_id { int32 id; }; id : Longint;
Screen_ID = record
ID : Integer
end; end;
//extern const struct screen_id B_MAIN_SCREEN_ID;
var var
{const} B_MAIN_SCREEN_ID : screen_id; cvar; external;
B_MAIN_SCREEN_ID : Screen_ID; cvar; external;
(*----------------------------------------------------------------*) (*----------------------------------------------------------------*)
type type
color_space = Cardinal;
Color_Space = Cardinal; // or is just word?
const const
B_NO_COLOR_SPACE = $0000; // byte in memory order, high bit first B_NO_COLOR_SPACE = $0000; // byte in memory order, high bit first
// linear color space (little endian is the default) // linear color space (little endian is the default)
@@ -237,24 +199,15 @@ const
B_BIG_RGB_32_BIT = B_RGB32_BIG; B_BIG_RGB_32_BIT = B_RGB32_BIG;
B_BIG_RGB_16_BIT = B_RGB15_BIG; B_BIG_RGB_16_BIT = B_RGB15_BIG;
// Find out whether a specific color space is supported by BBitmaps. // Find out whether a specific color space is supported by BBitmaps.
// Support_flags will be set to what kinds of support are available. // Support_flags will be set to what kinds of support are available.
// If support_flags is set to 0, false will be returned. // If support_flags is set to 0, false will be returned.
const const
B_VIEWS_SUPPORT_DRAW_BITMAP = $1; B_VIEWS_SUPPORT_DRAW_BITMAP = $1;
B_BITMAPS_SUPPORT_ATTACHED_VIEWS = $2; B_BITMAPS_SUPPORT_ATTACHED_VIEWS = $2;
// Check/Confirm This one, please. function bitmaps_support_space(space : color_space; support_flags : PLongoword)
function BitmapsSupportSpace(space : Color_Space; support_flags : PCardinal) : Boolean; cdecl; external 'be' name 'bitmaps_support_space';
: boolean; cdecl; external 'be' name 'bitmaps_support_space';
function GetPixelSizeFor(space : Color_Space; pixel_chunk : Status_t;
row_alignment : Status_t; pixels_per_chunk : Status_t)
: Status_t; cdecl; external 'be' name 'get_pixel_size_for';
{
_IMPEXP_BE bool bitmaps_support_space(color_space space, uint32 * support_flags);
// "pixel_chunk" is the native increment from one pixel starting on an integral // "pixel_chunk" is the native increment from one pixel starting on an integral
// byte to the next. // byte to the next.
@@ -263,43 +216,27 @@ _IMPEXP_BE bool bitmaps_support_space(color_space space, uint32 * support_flags)
// B_GRAY1 sets pixel_chunk to 1, row_alignment to 4 and pixels_per_chunk to 8, // B_GRAY1 sets pixel_chunk to 1, row_alignment to 4 and pixels_per_chunk to 8,
// whereas B_RGB24 sets pixel_chunk to 3, row_alignment to 4 and // whereas B_RGB24 sets pixel_chunk to 3, row_alignment to 4 and
// pixels_per_chunk to 1. // pixels_per_chunk to 1.
function get_pixel_size_for(space : color_space; var pixel_chunk : size_t;
_IMPEXP_BE status_t get_pixel_size_for(color_space space, size_t * pixel_chunk, var row_alignment : size_t; var pixels_per_chunk : size_t)
size_t * row_alignment, size_t * pixels_per_chunk); : status_t; cdecl; external 'be' name 'get_pixel_size_for';
}
(*----------------------------------------------------------------*) (*----------------------------------------------------------------*)
type type
BufferOrientation = (B_BUFFER_TOP_TO_BOTTOM, B_BUFFER_BOTTOM_TO_TOP); buffer_orientation = (B_BUFFER_TOP_TO_BOTTOM, B_BUFFER_BOTTOM_TO_TOP);
// Check/Confirm This one, please. buffer_layout = (unused_filler,
BufferLayout = (B_BUFFER_NONINTERLEAVED); // B_BUFFER_NONINTERLEAVED = 1 B_BUFFER_NONINTERLEAVED // = 1
);
(*----------------------------------------------------------------*) (*----------------------------------------------------------------*)
drawing_mode = (B_OP_COPY, B_OP_OVER, B_OP_ERASE, B_OP_INVERT, B_OP_ADD,
B_OP_SUBTRACT, B_OP_BLEND, B_OP_MIN, B_OP_MAX, B_OP_SELECT,
B_OP_ALPHA);
Drawing_Mode = (B_OP_COPY, B_OP_OVER, B_OP_ERASE, B_OP_INVERT, B_OP_ADD, source_alpha = (B_PIXEL_ALPHA, B_CONSTANT_ALPHA);
B_OP_SUBTRACT, B_OP_BLEND, B_OP_MIN, B_OP_MAX, alpha_function = (B_ALPHA_OVERLAY, B_ALPHA_COMPOSITE);
B_OP_SELECT, B_OP_ALPHA);
// Check/Confirm This one, please.
// this was:
// enum source_alpha {
// B_PIXEL_ALPHA=0,
// B_CONSTANT_ALPHA
// };
//
// enum alpha_function {
// B_ALPHA_OVERLAY=0,
// B_ALPHA_COMPOSITE
// };
Source_Alpha = (B_PIXEL_ALPHA, B_CONSTANT_ALPHA);
Alpha_Function = (B_ALPHA_OVERLAY, B_ALPHA_COMPOSITE);
const const
B_8_BIT_640x480 = $00000001; B_8_BIT_640x480 = $00000001;
B_8_BIT_800x600 = $00000002; B_8_BIT_800x600 = $00000002;
B_8_BIT_1024x768 = $00000004; B_8_BIT_1024x768 = $00000004;
@@ -327,44 +264,7 @@ const
// do not use B_FAKE_DEVICE--it will go away! // do not use B_FAKE_DEVICE--it will go away!
B_FAKE_DEVICE = $40000000; B_FAKE_DEVICE = $40000000;
B_8_BIT_640x400 = $80000000; // (int) B_8_BIT_640x400 = $80000000;
(*---------------------------------------------------------------------------*)
type
overlay_rect_limits = record
horizontal_alignment,
vertical_alignment,
width_alignment,
height_alignment,
min_width,
max_width,
min_height,
max_height : Word;
reserved : array [0..7] of Cardinal;
end;
overlay_restrictions = record
source,
destination : overlay_rect_limits;
min_width_scale,
max_width_scale,
min_height_scale,
max_height_scale : Double; // float
reserved : array [0..7] of Cardinal;
end;
(*---------------------------------------------------------------------------*)
function bitmaps_support_space(space : color_space; support_flags : PCardinal)
: boolean; cdecl; external 'be' name 'bitmaps_support_space';
function get_pixel_size_for(space : color_space; pixel_chunk : status_t;
row_alignment : status_t; pixels_per_chunk : status_t)
: status_t; cdecl; external 'be' name 'get_pixel_size_for';
(*---------------------------------------------------------------------------*) (*---------------------------------------------------------------------------*)

View File

@@ -32,18 +32,17 @@ type
modifiers : Longword; modifiers : Longword;
key_states : array[0..15] of Byte; key_states : array[0..15] of Byte;
end; end;
{
const const
// TODO: widestring these B_UTF8_ELLIPSIS : WideString = #$E2 + #$80 + #$A6;
B_UTF8_ELLIPSIS = '$E2 $80 $A6'; B_UTF8_OPEN_QUOTE : WideString = #$E2 + #$80 + #$9C;
B_UTF8_OPEN_QUOTE = '$E2 $80 $9C'; B_UTF8_CLOSE_QUOTE : WideString = #$E2 + #$80 + #$9D;
B_UTF8_CLOSE_QUOTE = '$E2 $80 $9D'; B_UTF8_COPYRIGHT : WideString = #$C2 + #$A9;
B_UTF8_COPYRIGHT = '$C2 $A9'; B_UTF8_REGISTERED : WideString = #$C2 + #$AE;
B_UTF8_REGISTERED = '$C2 $AE'; B_UTF8_TRADEMARK : WideString = #$E2 + #$84 + #$A2;
B_UTF8_TRADEMARK = '$E2 $84 $A2'; B_UTF8_SMILING_FACE : WideString = #$E2 + #$98 + #$BB;
B_UTF8_SMILING_FACE = '$E2 $98 $BB'; B_UTF8_HIROSHI : WideString = #$E5 + #$BC + #$98;
B_UTF8_HIROSHI = '$E5 $BC $98';
}
//---------------------------------------------------------------- //----------------------------------------------------------------
const const
@@ -124,6 +123,7 @@ type
dieresis_tables, dieresis_tables,
tilde_tables : Longword; tilde_tables : Longword;
end; end;
Pkey_map = ^key_map;
mouse_map = record mouse_map = record
left, left,
@@ -143,12 +143,15 @@ type
//---------------------------------------------------------------- //----------------------------------------------------------------
// duplicate join_mode = (B_ROUND_JOIN, B_MITER_JOIN, B_BEVEL_JOIN, B_BUTT_JOIN, B_SQUARE_JOIN); join_mode = (B_ROUND_JOIN, B_MITER_JOIN, B_BEVEL_JOIN, B_BUTT_JOIN, B_SQUARE_JOIN);
{
cap_mode = (B_ROUND_CAP = B_ROUND_JOIN, cap_mode = join_mode;
B_BUTT_CAP = B_BUTT_JOIN,
B_SQUARE_CAP = B_SQUARE_JOIN); var
} B_ROUND_CAP,
B_BUTT_CAP,
B_SQUARE_CAP : join_mode;
const const
B_DEFAULT_MITER_LIMIT = 10.0; B_DEFAULT_MITER_LIMIT = 10.0;
@@ -166,13 +169,14 @@ type
alignment = (B_ALIGN_LEFT, B_ALIGN_RIGHT, B_ALIGN_CENTER); alignment = (B_ALIGN_LEFT, B_ALIGN_RIGHT, B_ALIGN_CENTER);
(* // vertical_alignment was an enum
vertical_alignment = ( type
B_ALIGN_TOP = 0x10L, vertical_alignment = Longint;
B_ALIGN_MIDDLE = 0x20, const
B_ALIGN_BOTTOM = 0x30, B_ALIGN_TOP : Longint = $10;
B_ALIGN_NO_VERTICAL = -1L); B_ALIGN_MIDDLE : Longint = $20;
*) B_ALIGN_BOTTOM : Longint = $30;
B_ALIGN_NO_VERTICAL : Longint = -1;
//---------------------------------------------------------------- //----------------------------------------------------------------
@@ -209,80 +213,118 @@ const
//---------------------------------------------------------------- //----------------------------------------------------------------
type type
bitmap_tiling = (B_TILE_BITMAP_X, B_TILE_BITMAP_Y, B_TILE_BITMAP); bitmap_tiling = (B_TILE_BITMAP_X, B_TILE_BITMAP_Y, B_TILE_BITMAP);
{ // overlay_options was an enum
overlay_options = ( type
B_OVERLAY_FILTER_HORIZONTAL = 0x00010000, overlay_options = Longword;
B_OVERLAY_FILTER_VERTICAL = 0x00020000, const
B_OVERLAY_MIRROR = 0x00040000, B_OVERLAY_FILTER_HORIZONTAL = $00010000;
B_OVERLAY_TRANSFER_CHANNEL = 0x00080000); B_OVERLAY_FILTER_VERTICAL = $00020000;
} B_OVERLAY_MIRROR = $00040000;
B_OVERLAY_TRANSFER_CHANNEL = $00080000;
//---------------------------------------------------------------- //----------------------------------------------------------------
function get_deskbar_frame(frame : BRect) : status_t; cdecl; external 'be' name 'get_deskbar_frame__FP5BRect'; function get_deskbar_frame(frame : BRect) : status_t;
cdecl; external 'be' name 'get_deskbar_frame__FP5BRect';
function system_colors : color_map; cdecl; external 'be' name 'system_colors__Fv'; function system_colors : color_map; cdecl; external 'be' name 'system_colors__Fv';
function set_screen_space(index : Longint; res : Longword; stick : Boolean {$ifdef SupDefParm}= true{$endif}) : status_t; cdecl; external 'be' name 'set_screen_space__FlUlb'; function set_screen_space(index : Longint; res : Longword;
stick : Boolean {$ifndef VER1_0}= true{$endif})
: status_t; cdecl; external 'be' name 'set_screen_space__FlUlb';
function get_scroll_bar_info(info : scroll_bar_info) : status_t; cdecl; external 'be' name 'get_scroll_bar_info__FP15scroll_bar_info'; function get_scroll_bar_info(info : scroll_bar_info) : status_t;
function set_scroll_bar_info(info : scroll_bar_info) : status_t; cdecl; external 'be' name 'set_scroll_bar_info__FP15scroll_bar_info'; cdecl; external 'be' name 'get_scroll_bar_info__FP15scroll_bar_info';
function set_scroll_bar_info(info : scroll_bar_info) : status_t;
cdecl; external 'be' name 'set_scroll_bar_info__FP15scroll_bar_info';
function get_mouse_type(mtype : Longint) : status_t; cdecl; external 'be' name 'get_mouse_type__FPl'; function get_mouse_type(mtype : Longint) : status_t;
function set_mouse_type(mtype : Longint) : status_t; cdecl; external 'be' name 'set_mouse_type__Fl'; cdecl; external 'be' name 'get_mouse_type__FPl';
function get_mouse_map(map : mouse_map) : status_t; cdecl; external 'be' name 'get_mouse_map__FP9mouse_map'; function set_mouse_type(mtype : Longint) : status_t;
function set_mouse_map(map : mouse_map) : status_t; cdecl; external 'be' name 'set_mouse_map__FP9mouse_map'; cdecl; external 'be' name 'set_mouse_type__Fl';
function get_click_speed(speed : bigtime_t) : status_t; cdecl; external 'be' name 'get_click_speed__FPx'; function get_mouse_map(map : mouse_map) : status_t;
function set_click_speed(speed : bigtime_t) : status_t; cdecl; external 'be' name 'set_click_speed__Fx'; cdecl; external 'be' name 'get_mouse_map__FP9mouse_map';
function get_mouse_speed(speed : Longint) : status_t; cdecl; external 'be' name 'get_mouse_speed__FPl'; function set_mouse_map(map : mouse_map) : status_t;
function set_mouse_speed(speed : Longint) : status_t; cdecl; external 'be' name 'set_mouse_speed__Fl'; cdecl; external 'be' name 'set_mouse_map__FP9mouse_map';
function get_mouse_acceleration(speed : Longint) : status_t; cdecl; external 'be' name 'get_mouse_acceleration__FPl'; function get_click_speed(speed : bigtime_t) : status_t;
function set_mouse_acceleration(speed : Longint) : status_t; cdecl; external 'be' name 'set_mouse_acceleration__Fl'; cdecl; external 'be' name 'get_click_speed__FPx';
function set_click_speed(speed : bigtime_t) : status_t;
cdecl; external 'be' name 'set_click_speed__Fx';
function get_mouse_speed(speed : Longint) : status_t;
cdecl; external 'be' name 'get_mouse_speed__FPl';
function set_mouse_speed(speed : Longint) : status_t;
cdecl; external 'be' name 'set_mouse_speed__Fl';
function get_mouse_acceleration(speed : Longint) : status_t;
cdecl; external 'be' name 'get_mouse_acceleration__FPl';
function set_mouse_acceleration(speed : Longint) : status_t;
cdecl; external 'be' name 'set_mouse_acceleration__Fl';
function get_key_repeat_rate(rate : Longint) : status_t; cdecl; external 'be' name 'get_key_repeat_rate__FPl'; function get_key_repeat_rate(rate : Longint) : status_t;
function set_key_repeat_rate(rate : Longint) : status_t; cdecl; external 'be' name 'set_key_repeat_rate__Fl'; cdecl; external 'be' name 'get_key_repeat_rate__FPl';
function get_key_repeat_delay(delay : bigtime_t) : status_t; cdecl; external 'be' name 'get_key_repeat_delay__FPx'; function set_key_repeat_rate(rate : Longint) : status_t;
function set_key_repeat_delay(delay : bigtime_t) : status_t; cdecl; external 'be' name 'set_key_repeat_delay__Fx'; cdecl; external 'be' name 'set_key_repeat_rate__Fl';
function get_key_repeat_delay(delay : bigtime_t) : status_t;
cdecl; external 'be' name 'get_key_repeat_delay__FPx';
function set_key_repeat_delay(delay : bigtime_t) : status_t;
cdecl; external 'be' name 'set_key_repeat_delay__Fx';
function modifiers : Longword; cdecl; external 'be' name 'modifiers__Fv'; function modifiers : Longword; cdecl; external 'be' name 'modifiers__Fv';
function get_key_info(var info : key_info) : status_t; cdecl; external 'be' name 'get_key_info__FP8key_info'; function get_key_info(var info : key_info) : status_t;
//procedure get_key_map(key_map **map; char **key_buffer); cdecl; external 'be' name 'get_key_map__FPP7key_mapPPc'; cdecl; external 'be' name 'get_key_info__FP8key_info';
function get_keyboard_id(id : Word) : status_t; cdecl; external 'be' name 'get_keyboard_id__FPUs'; procedure get_key_map(var map : Pkey_map; var key_buffer : PChar);
procedure set_modifier_key(modifier, key : Longword); cdecl; external 'be' name 'set_modifier_key__FUlUl'; cdecl; external 'be' name 'get_key_map__FPP7key_mapPPc';
procedure set_keyboard_locks(modifiers : Longword); cdecl; external 'be' name 'set_keyboard_locks__FUl'; function get_keyboard_id(id : Word) : status_t;
cdecl; external 'be' name 'get_keyboard_id__FPUs';
procedure set_modifier_key(modifier, key : Longword);
cdecl; external 'be' name 'set_modifier_key__FUlUl';
procedure set_keyboard_locks(modifiers : Longword);
cdecl; external 'be' name 'set_keyboard_locks__FUl';
function keyboard_navigation_color : rgb_color; cdecl; external 'be' name 'keyboard_navigation_color__Fv'; function keyboard_navigation_color : rgb_color;
cdecl; external 'be' name 'keyboard_navigation_color__Fv';
function count_workspaces : Longint; cdecl; external 'be' name 'count_workspaces__Fv'; function count_workspaces : Longint;
procedure set_workspace_count(count : Longint); cdecl; external 'be' name 'set_workspace_count__Fl'; cdecl; external 'be' name 'count_workspaces__Fv';
function current_workspace : Longint; cdecl; external 'be' name 'current_workspace__Fv'; procedure set_workspace_count(count : Longint);
procedure activate_workspace(workspace : Longint); cdecl; external 'be' name 'activate_workspace__Fl'; cdecl; external 'be' name 'set_workspace_count__Fl';
function current_workspace : Longint;
cdecl; external 'be' name 'current_workspace__Fv';
procedure activate_workspace(workspace : Longint);
cdecl; external 'be' name 'activate_workspace__Fl';
function idle_time : bigtime_t; cdecl; external 'be' name 'idle_time__Fv'; function idle_time : bigtime_t; cdecl; external 'be' name 'idle_time__Fv';
procedure run_select_printer_panel; cdecl; external 'be' name 'run_select_printer_panel__Fv'; procedure run_select_printer_panel;
procedure run_add_printer_panel; cdecl; external 'be' name 'run_add_printer_panel__Fv'; cdecl; external 'be' name 'run_select_printer_panel__Fv';
procedure run_add_printer_panel;
cdecl; external 'be' name 'run_add_printer_panel__Fv';
procedure run_be_about; cdecl; external 'be' name 'run_be_about__Fv'; procedure run_be_about; cdecl; external 'be' name 'run_be_about__Fv';
procedure set_focus_follows_mouse(follow : Boolean); cdecl; external 'be' name 'set_focus_follows_mouse__Fb'; procedure set_focus_follows_mouse(follow : Boolean);
function focus_follows_mouse : Boolean; cdecl; external 'be' name 'focus_follows_mouse__Fv'; cdecl; external 'be' name 'set_focus_follows_mouse__Fb';
function focus_follows_mouse : Boolean;
cdecl; external 'be' name 'focus_follows_mouse__Fv';
//---------------------------------------------------------------- //----------------------------------------------------------------
type type
mode_mouse = (B_NORMAL_MOUSE, // = 0 mode_mouse = (
B_NORMAL_MOUSE, // = 0
B_FOCUS_FOLLOWS_MOUSE, // = 1 B_FOCUS_FOLLOWS_MOUSE, // = 1
bla, bla,
B_WARP_MOUSE, // = 3 B_WARP_MOUSE, // = 3
blabla, blabla,
blablabla, blablabla,
more_blablabla, more_blablabla,
B_INSTANT_WARP_MOUSE); // = 7 B_INSTANT_WARP_MOUSE // = 7
);
procedure set_mouse_mode(mode : mode_mouse); cdecl; external 'be' name 'set_mouse_mode__F10mode_mouse'; procedure set_mouse_mode(mode : mode_mouse);
function mouse_mode : mode_mouse; cdecl; external 'be' name 'mouse_mode__Fv'; cdecl; external 'be' name 'set_mouse_mode__F10mode_mouse';
function mouse_mode : mode_mouse;
cdecl; external 'be' name 'mouse_mode__Fv';
type type
// I re-ordered these to match BeAPI's values (BiPolar) // I re-ordered these to match BeAPI's values (BiPolar)
@@ -294,20 +336,8 @@ type
B_DESKTOP_COLOR, // 5 B_DESKTOP_COLOR, // 5
B_MENU_SELECTION_BACKGROUND_COLOR, // 6 B_MENU_SELECTION_BACKGROUND_COLOR, // 6
B_MENU_ITEM_TEXT_COLOR, // 7 B_MENU_ITEM_TEXT_COLOR, // 7
B_MENU_SELECTED_ITEM_TEXT_COLOR); // 8 B_MENU_SELECTED_ITEM_TEXT_COLOR // 8
);
join_mode =(
B_ROUND_JOIN,
B_MITER_JOIN,
B_BEVEL_JOIN,
B_BUTT_JOIN,
B_SQUARE_JOIN);
cap_mode = join_mode;
var
B_ROUND_CAP,
B_BUTT_CAP,
B_SQUARE_CAP : join_mode;
function ui_color(which : color_which) : rgb_color; cdecl; external 'be' name 'ui_color__F11color_which'; function ui_color(which : color_which) : rgb_color; cdecl; external 'be' name 'ui_color__F11color_which';
function tint_color(color : rgb_color; which : color_which) : rgb_color; cdecl; external 'be' name 'tint_color__FG9rgb_colorf'; function tint_color(color : rgb_color; which : color_which) : rgb_color; cdecl; external 'be' name 'tint_color__FG9rgb_colorf';
@@ -332,9 +362,8 @@ const
implementation implementation
Initialization initialization
B_ROUND_CAP := B_ROUND_JOIN; B_ROUND_CAP := B_ROUND_JOIN;
B_BUTT_CAP := B_BUTT_JOIN; B_BUTT_CAP := B_BUTT_JOIN;
B_SQUARE_CAP := B_SQUARE_JOIN; B_SQUARE_CAP := B_SQUARE_JOIN;
end. end.

View File

@@ -17,95 +17,119 @@
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
} }
unit radiobutton; unit RadioButton;
interface interface
uses uses
beobj, Control, Message, Archivable, SupportDefs, Rect, Handler; BeObj, Archivable, Control, Handler, Message, SupportDefs, Rect;
type type
BRadioButton = class(BControl) BRadioButton = class(BControl)
private
public public
constructor Create(aframe : BRect; name, aLabel : PChar; message : BMessage; sresizingMode, sflags : Cardinal); virtual; constructor Create(aframe : BRect; name, aLabel : PChar; message : BMessage;
resizingMode : Longword {$ifndef VER1_0}= B_FOLLOW_LEFT or B_FOLLOW_TOP{$endif};
flags : Longword {$ifndef VER1_0}= B_WILL_DRAW or B_NAVIGABLE{$endif}); virtual;
constructor Create(data : BMessage); override; constructor Create(data : BMessage); override;
destructor Destroy; override; destructor Destroy; override;
function Instantiate(data : BMessage) : BArchivable; function Instantiate(data : BMessage) : BArchivable;
function Archive(data : BMessage; deep : boolean) : Status_t; function Archive(data : BMessage; deep : Boolean {$ifndef VER1_0}= true{$endif}) : status_t;
procedure Draw(updateRect : BRect); override; procedure Draw(updateRect : BRect); override;
procedure MouseDown(where : BPoint); override; procedure MouseDown(where : BPoint); override;
procedure AttachedToWindow; override; procedure AttachedToWindow; override;
procedure KeyDown(bytes : PChar; numBytes : integer); override; procedure KeyDown(bytes : PChar; numBytes : Longint); override;
procedure SetValue(aValue : integer); procedure SetValue(aValue : Longint);
procedure GetPreferredSize(width : double; height : double); procedure GetPreferredSize(width, height : Single);
procedure ResizeToPreferred; override; procedure ResizeToPreferred; override;
function Invoke(msg : BMessage) : Status_t; function Invoke(msg : BMessage {$ifndef VER1_0}= nil{$endif}) : status_t;
procedure MessageReceived(msg : BMessage); override; procedure MessageReceived(msg : BMessage); override;
procedure WindowActivated(state : boolean); override; procedure WindowActivated(state : Boolean); override;
procedure MouseUp(pt : BPoint); override; procedure MouseUp(pt : BPoint); override;
procedure MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); override; procedure MouseMoved(pt : BPoint; code : Longword; msg : BMessage); override;
procedure DetachedFromWindow; override; procedure DetachedFromWindow; override;
procedure FrameMoved(new_position : BPoint); override; procedure FrameMoved(new_position : BPoint); override;
procedure FrameResized(new_width : double; new_height : double); override; procedure FrameResized(new_width, new_height : Single); override;
function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; function ResolveSpecifier(msg : BMessage; index : Longint;
procedure MakeFocus(state : boolean); specifier : BMessage; form : Longint;
properti : PChar) : BHandler;
procedure MakeFocus(state : Boolean {$ifndef VER1_0}= true{$endif});
procedure AllAttached; override; procedure AllAttached; override;
procedure AllDetached; override; procedure AllDetached; override;
function GetSupportedSuites(data : BMessage) : Status_t; function GetSupportedSuites(data : BMessage) : status_t;
function Perform(d : Perform_code; arg : Pointer) : Status_t; function Perform(d : Perform_code; arg : Pointer) : status_t;
// procedure _ReservedRadioButton1;
// procedure _ReservedRadioButton2;
// function operator=( : BRadioButton) : BRadioButton;
// procedure BBitmap *sBitmaps[2][3];
// procedure bool fOutlined;
// procedure uint32 _reserved[2];
end; end;
function BRadioButton_Create(AObject : TBeObject; frame : TCPlusObject; function BRadioButton_Create(AObject : TBeObject; frame : TCPlusObject;
name, aLabel : PChar; message : TCPlusObject; name, aLabel : PChar; message : TCPlusObject;
resizingMode, flags : Cardinal) : TCPlusObject; resizingMode, flags : Longword) : TCPlusObject;
cdecl; external BePascalLibName name 'BRadioButton_Create'; cdecl; external BePascalLibName name 'BRadioButton_Create';
function BRadioButton_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRadioButton_Create_1'; function BRadioButton_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject;
cdecl; external BePascalLibName name 'BRadioButton_Create_1';
procedure BRadioButton_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_FREE'; procedure BRadioButton_Free(AObject : TCPlusObject);
cdecl; external BePascalLibName name 'BRadioButton_FREE';
function BRadioButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : BArchivable; cdecl; external BePascalLibName name 'BRadioButton_Instantiate'; function BRadioButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject)
function BRadioButton_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Archive'; : BArchivable; cdecl; external BePascalLibName name 'BRadioButton_Instantiate';
procedure BRadioButton_Draw(AObject : TCPlusObject; updateRect : BRect); cdecl; external BePascalLibName name 'BRadioButton_Draw'; function BRadioButton_Archive(AObject : TCPlusObject; data : TCPlusObject;
procedure BRadioButton_MouseDown(AObject : TCPlusObject; where : BPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseDown'; deep : boolean) : status_t;
procedure BRadioButton_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AttachedToWindow'; cdecl; external BePascalLibName name 'BRadioButton_Archive';
procedure BRadioButton_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BRadioButton_KeyDown'; procedure BRadioButton_Draw(AObject : TCPlusObject; updateRect : BRect);
procedure BRadioButton_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BRadioButton_SetValue'; cdecl; external BePascalLibName name 'BRadioButton_Draw';
procedure BRadioButton_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BRadioButton_GetPreferredSize'; procedure BRadioButton_MouseDown(AObject : TCPlusObject; where : BPoint);
procedure BRadioButton_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_ResizeToPreferred'; cdecl; external BePascalLibName name 'BRadioButton_MouseDown';
function BRadioButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Invoke'; procedure BRadioButton_AttachedToWindow(AObject : TCPlusObject);
procedure BRadioButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MessageReceived'; cdecl; external BePascalLibName name 'BRadioButton_AttachedToWindow';
procedure BRadioButton_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_WindowActivated'; procedure BRadioButton_KeyDown(AObject : TCPlusObject; bytes : PChar;
procedure BRadioButton_MouseUp(AObject : TCPlusObject; pt : BPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseUp'; numBytes : integer);
procedure BRadioButton_MouseMoved(AObject : TCPlusObject; pt : BPoint; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MouseMoved'; cdecl; external BePascalLibName name 'BRadioButton_KeyDown';
procedure BRadioButton_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_DetachedFromWindow'; procedure BRadioButton_SetValue(AObject : TCPlusObject; value : integer);
procedure BRadioButton_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_FrameMoved'; cdecl; external BePascalLibName name 'BRadioButton_SetValue';
procedure BRadioButton_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BRadioButton_FrameResized'; procedure BRadioButton_GetPreferredSize(AObject : TCPlusObject; width, height : Single);
function BRadioButton_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : BHandler; cdecl; external BePascalLibName name 'BRadioButton_ResolveSpecifier'; cdecl; external BePascalLibName name 'BRadioButton_GetPreferredSize';
procedure BRadioButton_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_MakeFocus'; procedure BRadioButton_ResizeToPreferred(AObject : TCPlusObject);
procedure BRadioButton_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AllAttached'; cdecl; external BePascalLibName name 'BRadioButton_ResizeToPreferred';
procedure BRadioButton_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AllDetached'; function BRadioButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : status_t;
function BRadioButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_GetSupportedSuites'; cdecl; external BePascalLibName name 'BRadioButton_Invoke';
function BRadioButton_Perform(AObject : TCPlusObject; d : Perform_code; arg : Pointer) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Perform'; procedure BRadioButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject);
//procedure BRadioButton__ReservedRadioButton1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton1'; cdecl; external BePascalLibName name 'BRadioButton_MessageReceived';
//procedure BRadioButton__ReservedRadioButton2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton2'; procedure BRadioButton_WindowActivated(AObject : TCPlusObject; state : Boolean);
//function BRadioButton_operator=(AObject : TCPlusObject; : BRadioButton) : BRadioButton; cdecl; external BePascalLibName name 'BRadioButton_operator='; cdecl; external BePascalLibName name 'BRadioButton_WindowActivated';
//procedure BRadioButton_BBitmap *sBitmaps[2][3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_BBitmap *sBitmaps[2][3]'; procedure BRadioButton_MouseUp(AObject : TCPlusObject; pt : BPoint);
//procedure BRadioButton_bool fOutlined(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_bool fOutlined'; cdecl; external BePascalLibName name 'BRadioButton_MouseUp';
//procedure BRadioButton_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_uint32 _reserved[2]'; procedure BRadioButton_MouseMoved(AObject : TCPlusObject; pt : BPoint;
code : Cardinal; msg : TCPlusObject);
cdecl; external BePascalLibName name 'BRadioButton_MouseMoved';
procedure BRadioButton_DetachedFromWindow(AObject : TCPlusObject);
cdecl; external BePascalLibName name 'BRadioButton_DetachedFromWindow';
procedure BRadioButton_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject);
cdecl; external BePascalLibName name 'BRadioButton_FrameMoved';
procedure BRadioButton_FrameResized(AObject : TCPlusObject; new_width, new_height : Single);
cdecl; external BePascalLibName name 'BRadioButton_FrameResized';
function BRadioButton_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject;
index : integer; specifier : TCPlusObject;
form : integer; properti : PChar)
: BHandler; cdecl; external BePascalLibName name 'BRadioButton_ResolveSpecifier';
procedure BRadioButton_MakeFocus(AObject : TCPlusObject; state : Boolean);
cdecl; external BePascalLibName name 'BRadioButton_MakeFocus';
procedure BRadioButton_AllAttached(AObject : TCPlusObject);
cdecl; external BePascalLibName name 'BRadioButton_AllAttached';
procedure BRadioButton_AllDetached(AObject : TCPlusObject);
cdecl; external BePascalLibName name 'BRadioButton_AllDetached';
function BRadioButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject)
: status_t; cdecl; external BePascalLibName name 'BRadioButton_GetSupportedSuites';
function BRadioButton_Perform(AObject : TCPlusObject; d : perform_code; arg : Pointer) : status_t;
cdecl; external BePascalLibName name 'BRadioButton_Perform';
implementation implementation
constructor BRadioButton.Create(aframe : BRect; name, aLabel : PChar; message : BMessage; sresizingMode, sflags : Cardinal); constructor BRadioButton.Create(aframe : BRect; name, aLabel : PChar;
message : BMessage; sresizingMode,
sflags : Longword);
begin begin
CreatePas; CreatePas;
CPlusObject := BRadioButton_Create(Self, aframe.CPlusObject, name, aLabel, message.CPlusObject, sresizingMode, sflags); CPlusObject := BRadioButton_Create(Self, aframe.CPlusObject, name, aLabel,
message.CPlusObject, sresizingMode, sflags);
end; end;
constructor BRadioButton.Create(data : BMessage); constructor BRadioButton.Create(data : BMessage);
@@ -125,29 +149,29 @@ begin
Result := BRadioButton_Instantiate(CPlusObject, data.CPlusObject); Result := BRadioButton_Instantiate(CPlusObject, data.CPlusObject);
end; end;
function BRadioButton.Archive(data : BMessage; deep : boolean) : Status_t; function BRadioButton.Archive(data : BMessage; deep : Boolean) : status_t;
begin begin
Result := BRadioButton_Archive(CPlusObject, data.CPlusObject, deep); Result := BRadioButton_Archive(CPlusObject, data.CPlusObject, deep);
end; end;
procedure BRadioButton.Draw(updateRect : BRect); procedure BRadioButton.Draw(updateRect : BRect);
begin begin
// BRadioButton_Draw(CPlusObject, updateRect.CPlusObject); BRadioButton_Draw(CPlusObject, updateRect.CPlusObject);
end; end;
procedure BRadioButton.MouseDown(where : BPoint); procedure BRadioButton.MouseDown(where : BPoint);
begin begin
// BRadioButton_MouseDown(CPlusObject, where.CPlusObject); BRadioButton_MouseDown(CPlusObject, where.CPlusObject);
end; end;
procedure BRadioButton.AttachedToWindow; procedure BRadioButton.AttachedToWindow;
begin begin
// BRadioButton_AttachedToWindow(CPlusObject); BRadioButton_AttachedToWindow(CPlusObject);
end; end;
procedure BRadioButton.KeyDown(bytes : PChar; numBytes : integer); procedure BRadioButton.KeyDown(bytes : PChar; numBytes : integer);
begin begin
// BRadioButton_KeyDown(CPlusObject, bytes, numBytes); BRadioButton_KeyDown(CPlusObject, bytes, numBytes);
end; end;
procedure BRadioButton.SetValue(aValue : integer); procedure BRadioButton.SetValue(aValue : integer);
@@ -155,7 +179,7 @@ begin
BRadioButton_SetValue(CPlusObject, aValue); BRadioButton_SetValue(CPlusObject, aValue);
end; end;
procedure BRadioButton.GetPreferredSize(width : double; height : double); procedure BRadioButton.GetPreferredSize(width, height : Single);
begin begin
BRadioButton_GetPreferredSize(CPlusObject, width, height); BRadioButton_GetPreferredSize(CPlusObject, width, height);
end; end;
@@ -165,44 +189,44 @@ begin
BRadioButton_ResizeToPreferred(CPlusObject); BRadioButton_ResizeToPreferred(CPlusObject);
end; end;
function BRadioButton.Invoke(msg : BMessage) : Status_t; function BRadioButton.Invoke(msg : BMessage) : status_t;
begin begin
Result := BRadioButton_Invoke(CPlusObject, msg.CPlusObject); Result := BRadioButton_Invoke(CPlusObject, msg.CPlusObject);
end; end;
procedure BRadioButton.MessageReceived(msg : BMessage); procedure BRadioButton.MessageReceived(msg : BMessage);
begin begin
// BRadioButton_MessageReceived(CPlusObject, msg.CPlusObject); BRadioButton_MessageReceived(CPlusObject, msg.CPlusObject);
end; end;
procedure BRadioButton.WindowActivated(state : boolean); procedure BRadioButton.WindowActivated(state : Boolean);
begin begin
// BRadioButton_WindowActivated(CPlusObject, state); BRadioButton_WindowActivated(CPlusObject, state);
end; end;
procedure BRadioButton.MouseUp(pt : BPoint); procedure BRadioButton.MouseUp(pt : BPoint);
begin begin
// BRadioButton_MouseUp(CPlusObject, pt.CPlusObject); BRadioButton_MouseUp(CPlusObject, pt.CPlusObject);
end; end;
procedure BRadioButton.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); procedure BRadioButton.MouseMoved(pt : BPoint; code : Longword; msg : BMessage);
begin begin
// BRadioButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); BRadioButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg);
end; end;
procedure BRadioButton.DetachedFromWindow; procedure BRadioButton.DetachedFromWindow;
begin begin
// BRadioButton_DetachedFromWindow(CPlusObject); BRadioButton_DetachedFromWindow(CPlusObject);
end; end;
procedure BRadioButton.FrameMoved(new_position : BPoint); procedure BRadioButton.FrameMoved(new_position : BPoint);
begin begin
// BRadioButton_FrameMoved(CPlusObject, new_position.CPlusObject); BRadioButton_FrameMoved(CPlusObject, new_position.CPlusObject);
end; end;
procedure BRadioButton.FrameResized(new_width : double; new_height : double); procedure BRadioButton.FrameResized(new_width, new_height : Single);
begin begin
// BRadioButton_FrameResized(CPlusObject, new_width, new_height); BRadioButton_FrameResized(CPlusObject, new_width, new_height);
end; end;
function BRadioButton.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; function BRadioButton.ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler;
@@ -210,61 +234,29 @@ begin
Result := BRadioButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); Result := BRadioButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti);
end; end;
procedure BRadioButton.MakeFocus(state : boolean); procedure BRadioButton.MakeFocus(state : Boolean);
begin begin
BRadioButton_MakeFocus(CPlusObject, state); BRadioButton_MakeFocus(CPlusObject, state);
end; end;
procedure BRadioButton.AllAttached; procedure BRadioButton.AllAttached;
begin begin
// BRadioButton_AllAttached(CPlusObject); BRadioButton_AllAttached(CPlusObject);
end; end;
procedure BRadioButton.AllDetached; procedure BRadioButton.AllDetached;
begin begin
// BRadioButton_AllDetached(CPlusObject); BRadioButton_AllDetached(CPlusObject);
end; end;
function BRadioButton.GetSupportedSuites(data : BMessage) : Status_t; function BRadioButton.GetSupportedSuites(data : BMessage) : status_t;
begin begin
Result := BRadioButton_GetSupportedSuites(CPlusObject, data.CPlusObject); Result := BRadioButton_GetSupportedSuites(CPlusObject, data.CPlusObject);
end; end;
function BRadioButton.Perform(d : Perform_code; arg : Pointer) : Status_t; function BRadioButton.Perform(d : Perform_code; arg : Pointer) : status_t;
begin begin
Result := BRadioButton_Perform(CPlusObject, d, arg); Result := BRadioButton_Perform(CPlusObject, d, arg);
end; end;
{
procedure BRadioButton._ReservedRadioButton1;
begin
BRadioButton__ReservedRadioButton1(CPlusObject);
end;
procedure BRadioButton._ReservedRadioButton2;
begin
BRadioButton__ReservedRadioButton2(CPlusObject);
end;
function BRadioButton.operator=( : BRadioButton) : BRadioButton;
begin
Result := BRadioButton_operator=(CPlusObject, );
end;
procedure BRadioButton.BBitmap *sBitmaps[2][3];
begin
BRadioButton_BBitmap *sBitmaps[2][3](CPlusObject);
end;
procedure BRadioButton.bool fOutlined;
begin
BRadioButton_bool fOutlined(CPlusObject);
end;
procedure BRadioButton.uint32 _reserved[2];
begin
BRadioButton_uint32 _reserved[2](CPlusObject);
end;
}
end. end.

View File

@@ -1,5 +1,5 @@
{ BePascal - A pascal wrapper around the BeOS API { BePascal - A pascal wrapper around the BeOS API
Copyright (C) 2002 Olivier Coursiere Copyright (C) 2002-2003 Olivier Coursiere
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
@@ -15,13 +15,12 @@
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
} }
unit Rect;
unit rect;
interface interface
uses uses
beobj; BeObj;
type type
BRect = class; BRect = class;
@@ -29,27 +28,25 @@ type
BPoint = class(TBeObject) BPoint = class(TBeObject)
public public
constructor Create; override; constructor Create; override;
constructor Create(x, y : single); virtual; constructor Create(x, y : Single); virtual;
constructor Create(point : BPoint); virtual; constructor Create(point : BPoint); virtual;
destructor Destroy; override; destructor Destroy; override;
procedure ConstrainTo(Rect : BRect); procedure ConstrainTo(Rect : BRect);
procedure PrintToStream; procedure PrintToStream;
procedure Sept(x, y : single); procedure Sept(x, y : Single);
end; end;
type
// BPoint and BRect are defined in the same unit to avoid circular reference // BPoint and BRect are defined in the same unit to avoid circular reference
BRect = class(TBeObject) BRect = class(TBeObject)
private private
function Get_Left : single; function Get_Left : Single;
function Get_Right : single; function Get_Right : Single;
function Get_bottom : single; function Get_bottom : Single;
function Get_top : single; function Get_top : Single;
public public
constructor Create; override; constructor Create; override;
constructor Create(rect : BRect); virtual; // Problème de référence circulaire avec BPoint constructor Create(rect : BRect); virtual; // Problème de référence circulaire avec BPoint
constructor Create(l, t, r, b : single); constructor Create(l, t, r, b : Single);
constructor Create(leftTop, rightBottom : BPoint); virtual; constructor Create(leftTop, rightBottom : BPoint); virtual;
destructor Destroy; override; destructor Destroy; override;
procedure PrintToStream; procedure PrintToStream;
@@ -59,80 +56,121 @@ type
procedure SetLeftBottom(Rect : TCPlusObject; p : BPoint); procedure SetLeftBottom(Rect : TCPlusObject; p : BPoint);
procedure SetRightTop(Rect : TCPlusObject; p : BPoint); procedure SetRightTop(Rect : TCPlusObject; p : BPoint);
procedure InsetBy(Rect : TCPlusObject; p : BPoint); procedure InsetBy(Rect : TCPlusObject; p : BPoint);
procedure InsetBy(Rect : TCPlusObject; dx,dy : single); procedure InsetBy(Rect : TCPlusObject; dx, dy : Single);
procedure OffsetBy(Rect : TCPlusObject; p : BPoint); procedure OffsetBy(Rect : TCPlusObject; p : BPoint);
procedure OffSetBy(Rect : TCPlusObject; dx,dy : single); procedure OffSetBy(Rect : TCPlusObject; dx, dy : Single);
procedure OffsetTo(Rect : TCPlusObject; p : BPoint); procedure OffsetTo(Rect : TCPlusObject; p : BPoint);
procedure OffSetTo(Rect : TCPlusObject; dx,dy : single); procedure OffSetTo(Rect : TCPlusObject; dx, dy : Single);
function InsetBySelf(Rect : TCPlusObject; p : BPoint) : BRect; function InsetBySelf(Rect : TCPlusObject; p : BPoint) : BRect;
function InsetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; function InsetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect;
function InsetByCopy(Rect : TCPlusObject; p : BPoint) : BRect; function InsetByCopy(Rect : TCPlusObject; p : BPoint) : BRect;
function InsetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; function InsetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
function OffSetBySelf(Rect : TCPlusObject; p : BPoint) : BRect; function OffSetBySelf(Rect : TCPlusObject; p : BPoint) : BRect;
function OffSetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; function OffSetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect;
function OffSetByCopy(Rect : TCPlusObject; p : BPoint) : BRect; function OffSetByCopy(Rect : TCPlusObject; p : BPoint) : BRect;
function OffSetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; function OffSetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
function OffSetToSelf(Rect : TCPlusObject; p : BPoint): BRect; function OffSetToSelf(Rect : TCPlusObject; p : BPoint): BRect;
function OffSetToSelf(Rect : TCPlusObject; dx, dy :single): BRect; function OffSetToSelf(Rect : TCPlusObject; dx, dy :single): BRect;
function OffSetToCopy(Rect : TCPlusObject; p : BPoint) : BRect; function OffSetToCopy(Rect : TCPlusObject; p : BPoint) : BRect;
function OffSetToCopy(Rect : TCPlusObject; dx,dy :single): BRect; function OffSetToCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
function Intersects(Rect : TCPlusObject; p : Brect): boolean; function Intersects(Rect : TCPlusObject; p : BRect) : Boolean;
function Contains(Rect : TCPlusObject; p : BPoint): boolean; function Contains(Rect : TCPlusObject; p : BPoint) : Boolean;
function Contains(Rect : TCPlusObject; p : Brect): boolean; function Contains(Rect : TCPlusObject; p : BRect) : Boolean;
property left : Single read Get_left;
property left : single read Get_left; property right : Single read Get_right;
property right : single read Get_right; property bottom : Single read Get_bottom;
property bottom : single read Get_bottom; property top : Single read Get_top;
property top : single read Get_top;
end; end;
function BRect_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_1'; function BRect_Create(AObject : TBeObject) : TCPlusObject;
function BRect_Create(AObject : TBeObject; rect : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_2'; cdecl; external BePascalLibName name 'BRect_Create_1';
function BRect_Create(AObject : TBeObject; l, t, r, b : single) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_3'; function BRect_Create(AObject : TBeObject; rect : TCPlusObject) : TCPlusObject;
function BRect_Create(AObject : TBeObject; leftTop, rightBottom : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_4'; cdecl; external BePascalLibName name 'BRect_Create_2';
procedure BRect_Free(rect : TCPlusObject); cdecl; external BePascalLibName name 'BRect_Free'; function BRect_Create(AObject : TBeObject; l, t, r, b : Single) : TCPlusObject;
procedure BRect_PrintToStream(Rect : TCPlusObject); cdecl; external bePascalLibName name 'BRect_PrintToStream'; cdecl; external BePascalLibName name 'BRect_Create_3';
function BRect_left(Rect : TCPlusObject): single; cdecl; external bePascalLibName name 'BRect_left'; function BRect_Create(AObject : TBeObject; leftTop, rightBottom : TCPlusObject)
function BRect_right(Rect : TCPlusObject): single; cdecl; external bePascalLibName name 'BRect_right'; : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_4';
function BRect_bottom(Rect : TCPlusObject): single; cdecl; external bePascalLibName name 'BRect_bottom'; procedure BRect_Free(rect : TCPlusObject);
function BRect_top(Rect : TCPlusObject): single; cdecl; external bePascalLibName name 'BRect_top'; cdecl; external BePascalLibName name 'BRect_Free';
procedure BRect_SetLeftTop(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_SetLeftTop'; procedure BRect_PrintToStream(Rect : TCPlusObject);
procedure BRect_SetRightBottom(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_SetRightBottom'; cdecl; external bePascalLibName name 'BRect_PrintToStream';
procedure BRect_SetLeftBottom(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_SetLeftBottom'; function BRect_left(Rect : TCPlusObject) : Single;
procedure BRect_SetRightTop(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_SetRightTop'; cdecl; external bePascalLibName name 'BRect_left';
procedure BRect_InsetBy(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_InsetBy'; function BRect_right(Rect : TCPlusObject) : Single;
procedure BRect_InsetBy(Rect : TCPlusObject; dx,dy : single); cdecl; external bePascalLibName name 'BRect_InsetBy_1'; cdecl; external bePascalLibName name 'BRect_right';
procedure BRect_OffsetBy(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_OffsetBy'; function BRect_bottom(Rect : TCPlusObject) : Single;
procedure BRect_OffSetBy(Rect : TCPlusObject; dx,dy : single); cdecl; external bePascalLibName name 'BRect_OffsetBy_1'; cdecl; external bePascalLibName name 'BRect_bottom';
procedure BRect_OffsetTo(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_OffsetTo'; function BRect_top(Rect : TCPlusObject) : Single;
procedure BRect_OffSetTo(Rect : TCPlusObject; dx,dy : single); cdecl; external bePascalLibName name 'BRect_OffsetTo_1'; cdecl; external bePascalLibName name 'BRect_top';
function BRect_InsetBySelf(Rect : TCPlusObject; p : BPoint): BRect; cdecl; external bePascalLibName name 'BRect_InsetBySelf';
function BRect_InsetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; cdecl; external bePascalLibName name 'BRect_InsetBySelf_1'; procedure BRect_SetLeftTop(Rect : TCPlusObject; p : BPoint);
function BRect_InsetByCopy(Rect : TCPlusObject; p : BPoint): BRect; cdecl; external bePascalLibName name 'BRect_InsetByCopy'; cdecl; external bePascalLibName name 'BRect_SetLeftTop';
function BRect_InsetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; cdecl; external bePascalLibName name 'BRect_InsetByCopy_1'; procedure BRect_SetRightBottom(Rect : TCPlusObject; p : BPoint);
function BRect_OffSetBySelf(Rect : TCPlusObject; p : BPoint): BRect; cdecl; external bePascalLibName name 'BRect_OffsetBySelf'; cdecl; external bePascalLibName name 'BRect_SetRightBottom';
function BRect_OffSetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; cdecl; external bePascalLibName name 'BRect_OffsetBySelf_1'; procedure BRect_SetLeftBottom(Rect : TCPlusObject; p : BPoint);
function BRect_OffSetByCopy(Rect : TCPlusObject; p : BPoint): BRect; cdecl; external bePascalLibName name 'BRect_OffsetByCopy'; cdecl; external bePascalLibName name 'BRect_SetLeftBottom';
function BRect_OffSetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; cdecl; external bePascalLibName name 'BRect_OffsetByCopy_1'; procedure BRect_SetRightTop(Rect : TCPlusObject; p : BPoint);
function BRect_OffSetToSelf(Rect : TCPlusObject; p : BPoint): BRect; cdecl; external bePascalLibName name 'BRect_OffsetToSelf'; cdecl; external bePascalLibName name 'BRect_SetRightTop';
function BRect_OffSetToSelf(Rect : TCPlusObject; dx,dy :single): BRect; cdecl; external bePascalLibName name 'BRect_OffsetToSelf_1'; procedure BRect_InsetBy(Rect : TCPlusObject; p : BPoint);
function BRect_OffSetToCopy(Rect : TCPlusObject; p : BPoint): BRect; cdecl; external bePascalLibName name 'BRect_OffsetToCopy'; cdecl; external bePascalLibName name 'BRect_InsetBy';
function BRect_OffSetToCopy(Rect : TCPlusObject; dx,dy :single): BRect; cdecl; external bePascalLibName name 'BRect_OffsetToCopy_1'; procedure BRect_InsetBy(Rect : TCPlusObject; dx, dy : Single);
function BRect_Intersects(Rect : TCPlusObject; p : Brect): boolean; cdecl; external bePascalLibName name 'BRect_Intersects'; cdecl; external bePascalLibName name 'BRect_InsetBy_1';
function BRect_Contains(Rect : TCPlusObject; p : BPoint): boolean; cdecl; external bePascalLibName name 'BRect_Contains'; procedure BRect_OffsetBy(Rect : TCPlusObject; p : BPoint);
function BRect_Contains(Rect : TCPlusObject; p : Brect): boolean; cdecl; external bePascalLibName name 'BRect_Contains_1'; cdecl; external bePascalLibName name 'BRect_OffsetBy';
procedure BRect_OffSetBy(Rect : TCPlusObject; dx, dy : Single);
cdecl; external bePascalLibName name 'BRect_OffsetBy_1';
procedure BRect_OffsetTo(Rect : TCPlusObject; p : BPoint);
cdecl; external bePascalLibName name 'BRect_OffsetTo';
procedure BRect_OffSetTo(Rect : TCPlusObject; dx, dy : Single);
cdecl; external bePascalLibName name 'BRect_OffsetTo_1';
function BRect_InsetBySelf(Rect : TCPlusObject; p : BPoint) : BRect;
cdecl; external bePascalLibName name 'BRect_InsetBySelf';
function BRect_InsetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect;
cdecl; external bePascalLibName name 'BRect_InsetBySelf_1';
function BRect_InsetByCopy(Rect : TCPlusObject; p : BPoint) : BRect;
cdecl; external bePascalLibName name 'BRect_InsetByCopy';
function BRect_InsetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
cdecl; external bePascalLibName name 'BRect_InsetByCopy_1';
function BRect_OffSetBySelf(Rect : TCPlusObject; p : BPoint) : BRect;
cdecl; external bePascalLibName name 'BRect_OffsetBySelf';
function BRect_OffSetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect;
cdecl; external bePascalLibName name 'BRect_OffsetBySelf_1';
function BRect_OffSetByCopy(Rect : TCPlusObject; p : BPoint) : BRect;
cdecl; external bePascalLibName name 'BRect_OffsetByCopy';
function BRect_OffSetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
cdecl; external bePascalLibName name 'BRect_OffsetByCopy_1';
function BRect_OffSetToSelf(Rect : TCPlusObject; p : BPoint) : BRect;
cdecl; external bePascalLibName name 'BRect_OffsetToSelf';
function BRect_OffSetToSelf(Rect : TCPlusObject; dx, dy : Single) : BRect;
cdecl; external bePascalLibName name 'BRect_OffsetToSelf_1';
function BRect_OffSetToCopy(Rect : TCPlusObject; p : BPoint) : BRect;
cdecl; external bePascalLibName name 'BRect_OffsetToCopy';
function BRect_OffSetToCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
cdecl; external bePascalLibName name 'BRect_OffsetToCopy_1';
function BRect_Intersects(Rect : TCPlusObject; p : BRect) : Boolean;
cdecl; external bePascalLibName name 'BRect_Intersects';
function BRect_Contains(Rect : TCPlusObject; p : BPoint) : Boolean;
cdecl; external bePascalLibName name 'BRect_Contains';
function BRect_Contains(Rect : TCPlusObject; p : BRect) : Boolean;
cdecl; external bePascalLibName name 'BRect_Contains_1';
function BPoint_Create(AObject : TBeObject; x, y : single) : TCPlusObject;
function BPoint_Create(AObject : TBeObject; x, y : single) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_1'; cdecl; external BePascalLibName name 'BPoint_Create_1';
function BPoint_Create(AObject : TBeObject; point : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_2'; function BPoint_Create(AObject : TBeObject; point : TCPlusObject) : TCPlusObject;
function BPoint_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_3'; cdecl; external BePascalLibName name 'BPoint_Create_2';
procedure BPoint_Free(Point : TCPlusObject); cdecl; external BePascalLibName name 'BPoint_Free'; function BPoint_Create(AObject : TBeObject) : TCPlusObject;
procedure BPoint_ConstrainTo(Point : TCPlusObject; Rect : TCPlusObject); cdecl; external BePascalLibName name 'BPoint_ConstrainTo'; cdecl; external BePascalLibName name 'BPoint_Create_3';
procedure BPoint_PrintToStream(Point : TCPlusObject); cdecl; external bePascalLibName name 'BPoint_PrintToStream'; procedure BPoint_Free(Point : TCPlusObject);
procedure BPoint_Set(Point : TCPlusObject; x, y : single); cdecl; external BePascalLibName name 'BPoint_Set'; cdecl; external BePascalLibName name 'BPoint_Free';
procedure BPoint_ConstrainTo(Point : TCPlusObject; Rect : TCPlusObject);
cdecl; external BePascalLibName name 'BPoint_ConstrainTo';
procedure BPoint_PrintToStream(Point : TCPlusObject);
cdecl; external bePascalLibName name 'BPoint_PrintToStream';
procedure BPoint_Set(Point : TCPlusObject; x, y : Single);
cdecl; external BePascalLibName name 'BPoint_Set';
implementation implementation
@@ -148,7 +186,7 @@ begin
CPlusObject := BRect_Create(Self, rect.CPlusObject); CPlusObject := BRect_Create(Self, rect.CPlusObject);
end; end;
constructor BRect.Create(l, t, r, b : single); constructor BRect.Create(l, t, r, b : Single);
begin begin
inherited Create; inherited Create;
CPlusObject := BRect_Create(Self, l, t, r, b); CPlusObject := BRect_Create(Self, l, t, r, b);
@@ -171,155 +209,154 @@ begin
BRect_PrintToStream(CPlusObject); BRect_PrintToStream(CPlusObject);
end; end;
function Brect.Get_Left : single; function BRect.Get_Left : Single;
begin begin
result:=BRect_left(CPlusObject); Result := BRect_left(CPlusObject);
end;
function Brect.Get_right : single;
begin
result:=BRect_right(CPlusObject);
end;
function Brect.Get_bottom : single;
begin
result:=BRect_bottom(CPlusObject);
end;
function Brect.Get_top : single;
begin
result:=BRect_top(CPlusObject);
end; end;
function BRect.Get_right : Single;
begin
Result := BRect_right(CPlusObject);
end;
procedure Brect.SetLeftTop(Rect : TCPlusObject; p : BPoint); function BRect.Get_bottom : Single;
begin
Result := BRect_bottom(CPlusObject);
end;
function BRect.Get_top : Single;
begin
Result := BRect_top(CPlusObject);
end;
procedure BRect.SetLeftTop(Rect : TCPlusObject; p : BPoint);
begin begin
BRect_SetLeftTop(CPlusObject, p); BRect_SetLeftTop(CPlusObject, p);
end; end;
procedure Brect.SetRightBottom(Rect : TCPlusObject; p : BPoint); procedure BRect.SetRightBottom(Rect : TCPlusObject; p : BPoint);
begin begin
BRect_SetRightBottom(CPlusObject, p); BRect_SetRightBottom(CPlusObject, p);
end; end;
procedure Brect.SetLeftBottom(Rect : TCPlusObject; p : BPoint); procedure BRect.SetLeftBottom(Rect : TCPlusObject; p : BPoint);
begin begin
BRect_SetLeftBottom(CPlusObject, p); BRect_SetLeftBottom(CPlusObject, p);
end; end;
procedure Brect.SetRightTop(Rect : TCPlusObject; p : BPoint); procedure BRect.SetRightTop(Rect : TCPlusObject; p : BPoint);
begin begin
BRect_SetRightTop(CPlusObject, p); BRect_SetRightTop(CPlusObject, p);
end; end;
procedure Brect.InsetBy(Rect : TCPlusObject; p : BPoint); procedure BRect.InsetBy(Rect : TCPlusObject; p : BPoint);
begin begin
BRect_InsetBy(CPlusObject, p); BRect_InsetBy(CPlusObject, p);
end; end;
procedure Brect.InsetBy(Rect : TCPlusObject; dx,dy : single); procedure BRect.InsetBy(Rect : TCPlusObject; dx, dy : Single);
begin begin
BRect_InsetBy(CPlusObject, dx, dy); BRect_InsetBy(CPlusObject, dx, dy);
end; end;
procedure Brect.OffsetBy(Rect : TCPlusObject; p : BPoint); procedure BRect.OffsetBy(Rect : TCPlusObject; p : BPoint);
begin begin
BRect_OffsetBy(CPlusObject, p); BRect_OffsetBy(CPlusObject, p);
end; end;
procedure Brect.OffSetBy(Rect : TCPlusObject; dx,dy : single); procedure BRect.OffSetBy(Rect : TCPlusObject; dx, dy : Single);
begin begin
BRect_OffSetBy(CPlusObject, dx, dy); BRect_OffSetBy(CPlusObject, dx, dy);
end; end;
procedure Brect.OffsetTo(Rect : TCPlusObject; p : BPoint); procedure BRect.OffsetTo(Rect : TCPlusObject; p : BPoint);
begin begin
BRect_OffsetTo(CPlusObject, p); BRect_OffsetTo(CPlusObject, p);
end; end;
procedure Brect.OffSetTo(Rect : TCPlusObject; dx,dy : single); procedure BRect.OffSetTo(Rect : TCPlusObject; dx, dy : Single);
begin begin
BRect_OffSetTo(CPlusObject, dx, dy); BRect_OffSetTo(CPlusObject, dx, dy);
end; end;
function Brect.InsetBySelf(Rect : TCPlusObject; p : BPoint): BRect; function BRect.InsetBySelf(Rect : TCPlusObject; p : BPoint) : BRect;
begin begin
result:=BRect_InsetBySelf(CPlusObject,p); Result := BRect_InsetBySelf(CPlusObject, p);
end; end;
function Brect.InsetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; function BRect.InsetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect;
begin begin
result:=BRect_InsetBySelf(CPlusObject,dx,dy); Result := BRect_InsetBySelf(CPlusObject, dx, dy);
end; end;
function Brect.InsetByCopy(Rect : TCPlusObject; p : BPoint): BRect; function BRect.InsetByCopy(Rect : TCPlusObject; p : BPoint) : BRect;
begin begin
result:=BRect_InsetByCopy(CPlusObject,p); Result := BRect_InsetByCopy(CPlusObject, p);
end; end;
function Brect.InsetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; function BRect.InsetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
begin begin
result:=BRect_InsetByCopy(CPlusObject,dx,dy); Result := BRect_InsetByCopy(CPlusObject, dx, dy);
end; end;
function Brect.OffSetBySelf(Rect : TCPlusObject; p : BPoint): BRect; function BRect.OffSetBySelf(Rect : TCPlusObject; p : BPoint) : BRect;
begin begin
result:=BRect_OffSetBySelf(CPlusObject,p); Result := BRect_OffSetBySelf(CPlusObject, p);
end; end;
function Brect.OffSetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; function BRect.OffSetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect;
begin begin
result:=BRect_OffSetBySelf(CPlusObject,dx,dy); Result := BRect_OffSetBySelf(CPlusObject, dx, dy);
end; end;
function Brect.OffSetByCopy(Rect : TCPlusObject; p : BPoint): BRect; function BRect.OffSetByCopy(Rect : TCPlusObject; p : BPoint) : BRect;
begin begin
result:=BRect_OffSetByCopy(CPlusObject,p); Result := BRect_OffSetByCopy(CPlusObject, p);
end; end;
function Brect.OffSetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; function BRect.OffSetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
begin begin
result:=BRect_OffSetByCopy(CPlusObject,dx,dy); Result := BRect_OffSetByCopy(CPlusObject, dx, dy);
end; end;
function Brect.OffSetToSelf(Rect : TCPlusObject; p : BPoint): BRect; function BRect.OffSetToSelf(Rect : TCPlusObject; p : BPoint) : BRect;
begin begin
result:=BRect_OffSetToSelf(CPlusObject,p); Result := BRect_OffSetToSelf(CPlusObject,p);
end; end;
function Brect.OffSetToSelf(Rect : TCPlusObject; dx,dy :single): BRect; function BRect.OffSetToSelf(Rect : TCPlusObject; dx, dy : Single) : BRect;
begin begin
result:=BRect_OffSetToSelf(CPlusObject,dx,dy); Result := BRect_OffSetToSelf(CPlusObject, dx, dy);
end; end;
function Brect.OffSetToCopy(Rect : TCPlusObject; p : BPoint): BRect; function BRect.OffSetToCopy(Rect : TCPlusObject; p : BPoint) : BRect;
begin begin
result:=BRect_OffSetToCopy(CPlusObject,p); Result := BRect_OffSetToCopy(CPlusObject, p);
end; end;
function Brect.OffSetToCopy(Rect : TCPlusObject; dx,dy :single): BRect; function BRect.OffSetToCopy(Rect : TCPlusObject; dx, dy : Single) : BRect;
begin begin
result:=BRect_OffSetToCopy(CPlusObject,dx,dy); Result := BRect_OffSetToCopy(CPlusObject, dx, dy);
end; end;
function Brect.Intersects(Rect : TCPlusObject; p : Brect): boolean; function BRect.Intersects(Rect : TCPlusObject; p : BRect) : Boolean;
begin begin
result:=BRect_Intersects(CPlusObject,p); Result := BRect_Intersects(CPlusObject, p);
end; end;
function Brect.Contains(Rect : TCPlusObject; p : BPoint): boolean; function BRect.Contains(Rect : TCPlusObject; p : BPoint) : Boolean;
begin begin
result:=BRect_Contains(CPlusObject,p); Result := BRect_Contains(CPlusObject, p);
end; end;
function Brect.Contains(Rect : TCPlusObject; p : Brect): boolean; function BRect.Contains(Rect : TCPlusObject; p : BRect) : Boolean;
begin begin
result:=BRect_Contains(CPlusObject,p); Result := BRect_Contains(CPlusObject, p);
end; end;
// BPoint // BPoint
constructor BPoint.Create(x, y : single); constructor BPoint.Create(x, y : Single);
begin begin
inherited Create; inherited Create;
CPlusObject := BPoint_Create(Self, x, y); CPlusObject := BPoint_Create(Self, x, y);
@@ -353,13 +390,9 @@ begin
BPoint_PrintToStream(CPlusObject); BPoint_PrintToStream(CPlusObject);
end; end;
procedure BPoint.Sept(x, y : single); procedure BPoint.Sept(x, y : Single);
begin begin
BPoint_Set(CPlusObject, x, y); BPoint_Set(CPlusObject, x, y);
end; end;
initialization
end. end.