From 44a8d138689421aa96cced7b143002706f44aad1 Mon Sep 17 00:00:00 2001 From: oscarl-2 Date: Sat, 20 Dec 2003 20:16:45 +0000 Subject: [PATCH] minor corrections to latest CVS merge and other misc changes. --- .../bepascal/pas/src/be/interface/alert.pp | 159 +++++--- .../pas/src/be/interface/graphicdefs.pp | 372 +++++++----------- .../pas/src/be/interface/interfacedefs.pp | 217 +++++----- .../pas/src/be/interface/radiobutton.pp | 224 +++++------ .../bepascal/pas/src/be/interface/rect.pp | 355 +++++++++-------- 5 files changed, 658 insertions(+), 669 deletions(-) diff --git a/bepascal/source/bepascal/pas/src/be/interface/alert.pp b/bepascal/source/bepascal/pas/src/be/interface/alert.pp index e8c50fd..563a547 100644 --- a/bepascal/source/bepascal/pas/src/be/interface/alert.pp +++ b/bepascal/source/bepascal/pas/src/be/interface/alert.pp @@ -22,87 +22,123 @@ unit Alert; interface uses - BeObj, Archivable, Button, InterfaceDefs, Invoker, Handler, - Message, Rect, SupportDefs, TextView, Window; + BeObj, Archivable, Button, InterfaceDefs, Invoker, Handler, Message, Rect, + SupportDefs, TextView, Window; type -{ enum for flavors of alert } -// enum alert_type - Alert_Type = (B_EMPTY_ALERT, B_INFO_ALERT, B_IDEA_ALERT, B_WARNING_ALERT, - B_STOP_ALERT); + alert_type = ( + B_EMPTY_ALERT, + B_INFO_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) private public - // Here we have this name colition: type --> kind constructor Create(title : PChar; text : PChar; button1 : PChar; - button2 : PChar; button3 : PChar; width : Button_Width; - kind{type} : Alert_Type); + button2 : PChar {$ifndef VER1_0}= nil{$endif}; + 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; - button2 : PChar; button3 : PChar; width : Button_Width; - spacing : Button_Spacing; kind{type} : Alert_Type); + button2 : PChar; button3 : PChar; width : button_width; + spacing : button_spacing; + type_ : alert_type {$ifndef VER1_0}= B_INFO_ALERT{$endif}); constructor Create(data : BMessage); destructor Destroy; override; function Instantiate(data : BMessage) : BArchivable; - function Archive(data : BMessage; deep : boolean) : Status_t; - procedure SetShortcut(button_index : integer; key : Char); - function Shortcut(button_index : integer) : Char; - function Go : integer; - function Go(invoker : BInvoker) : Status_t; + function Archive(data : BMessage; deep : Boolean {$ifndef VER1_0}= true{$endif}) : status_t; + procedure SetShortcut(button_index : Longint; key : Char); + function Shortcut(button_index : Longint) : Char; + function Go : Longint; + function Go(invoker : BInvoker) : status_t; procedure MessageReceived(an_event : BMessage); override; - procedure FrameResized(new_width : double; new_height : double); - function ButtonAt(index : integer) : BButton; + procedure FrameResized(new_width, new_height : Single); + function ButtonAt(index : Longint) : BButton; function TextView : BTextView; - function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; - function GetSupportedSuites(data : BMessage) : Status_t; + function ResolveSpecifier(msg : BMessage; index : Longint; specifier : BMessage; form : Longint; properti : PChar) : BHandler; + function GetSupportedSuites(data : BMessage) : status_t; procedure DispatchMessage(msg : BMessage; handler : BHandler); override; procedure Quit; - function QuitRequested : boolean; override; - function AlertPosition(width : double; height : double) : BPoint; + function QuitRequested : Boolean; override; + function AlertPosition(width, height : Single) : BPoint; 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_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_Create_2(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BAlert_Create_2'; +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'; -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_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BAlert_Archive'; -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'; -function BAlert_Go(AObject : TCPlusObject) : integer; 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 : double; new_height : double); cdecl; external BePascalLibName name 'BAlert_FrameResized'; -function BAlert_ButtonAt(AObject : TCPlusObject; index : integer) : 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 : integer; specifier : TCPlusObject; form : integer; 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 : double; height : double) : BPoint; cdecl; external BePascalLibName name 'BAlert_AlertPosition'; +function BAlert_Create_2(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; + cdecl; external BePascalLibName name 'BAlert_Create_2'; + +procedure BAlert_Free(AObject : TCPlusObject); + cdecl; external BePascalLibName name 'BAlert_Free'; + +function BAlert_Instantiate(AObject : TCPlusObject; data : TCPlusObject) + : BArchivable; cdecl; external BePascalLibName name 'BAlert_Instantiate'; +function BAlert_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) + : Status_t; cdecl; external BePascalLibName name 'BAlert_Archive'; +procedure BAlert_SetShortcut(AObject : TCPlusObject; button_index : Longint; key : Char); + cdecl; external BePascalLibName name 'BAlert_SetShortcut'; +function BAlert_Shortcut(AObject : TCPlusObject; button_index : Longint) : Char; + cdecl; external BePascalLibName name 'BAlert_Shortcut'; +function BAlert_Go(AObject : TCPlusObject) : Longint; + 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 constructor BAlert.Create(title : PChar; text : PChar; button1 : PChar; - button2 : PChar; button3 : PChar; width : Button_Width; - kind{type} : Alert_Type); + button2 : PChar; button3 : PChar; width : button_width; + type_ : alert_type); begin CPlusObject := BAlert_Create(Self, title, text, button1, button2, button3, - width, kind); + width, type_); 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 CPlusObject := BAlert_Create_1(Self, title, text, button1, button2, button3, - width, spacing, kind{type}); + width, spacing, type_); end; constructor BAlert.Create(data : BMessage); @@ -120,27 +156,27 @@ begin Result := BAlert_Instantiate(CPlusObject, data.CPlusObject); end; -function BAlert.Archive(data : BMessage; deep : boolean) : Status_t; +function BAlert.Archive(data : BMessage; deep : Boolean) : status_t; begin Result := BAlert_Archive(CPlusObject, data.CPlusObject, deep); end; -procedure BAlert.SetShortcut(button_index : integer; key : Char); +procedure BAlert.SetShortcut(button_index : Longint; key : Char); begin BAlert_SetShortcut(CPlusObject, button_index, key); end; -function BAlert.Shortcut(button_index : integer) : Char; +function BAlert.Shortcut(button_index : Longint) : Char; begin Result := BAlert_Shortcut(CPlusObject, button_index); end; -function BAlert.Go : integer; +function BAlert.Go : Longint; begin Result := BAlert_Go(CPlusObject); end; -function BAlert.Go(invoker : BInvoker) : Status_t; +function BAlert.Go(invoker : BInvoker) : status_t; begin Result := BAlert_Go(CPlusObject, invoker.CPlusObject); end; @@ -150,12 +186,12 @@ begin BAlert_MessageReceived(CPlusObject, an_event.CPlusObject); end; -procedure BAlert.FrameResized(new_width : double; new_height : double); +procedure BAlert.FrameResized(new_width, new_height : Single); begin BAlert_FrameResized(CPlusObject, new_width, new_height); end; -function BAlert.ButtonAt(index : integer) : BButton; +function BAlert.ButtonAt(index : Longint) : BButton; begin Result := BAlert_ButtonAt(CPlusObject, index); end; @@ -165,12 +201,12 @@ begin Result := BAlert_TextView(CPlusObject); 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 Result := BAlert_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); end; -function BAlert.GetSupportedSuites(data : BMessage) : Status_t; +function BAlert.GetSupportedSuites(data : BMessage) : status_t; begin Result := BAlert_GetSupportedSuites(CPlusObject, data.CPlusObject); end; @@ -185,15 +221,14 @@ begin BAlert_Quit(CPlusObject); end; -function BAlert.QuitRequested : boolean; +function BAlert.QuitRequested : Boolean; begin Result := BAlert_QuitRequested(CPlusObject); end; -function BAlert.AlertPosition(width : double; height : double) : BPoint; +function BAlert.AlertPosition(width : Single; height : Single) : BPoint; begin Result := BAlert_AlertPosition(CPlusObject, width, height); end; - -end. +end. \ No newline at end of file diff --git a/bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp b/bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp index 60f3787..5b196f6 100644 --- a/bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp +++ b/bepascal/source/bepascal/pas/src/be/interface/graphicdefs.pp @@ -20,22 +20,6 @@ } 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 uses @@ -43,218 +27,187 @@ uses {$PACKRECORDS C} - type // This one must be find a better place. PCardinal = ^Cardinal; + PLongword = ^Longword; (*----------------------------------------------------------------*) type - { TPattern = pattern } - Pattern = record - Data : array [0..7] of Byte; // uint8 + pattern = record + data : array [0..7] of Byte; end; -// How we do 'export' these global const? -// Check/Confirm This one, please. - -var {const} - B_SOLID_HIGH : Pattern; cvar; external; - B_MIXED_COLORS : Pattern; cvar; external; - B_SOLID_LOW : Pattern; cvar; external; +var + B_SOLID_HIGH : pattern; cvar; external; + B_MIXED_COLORS : pattern; cvar; external; + B_SOLID_LOW : pattern; cvar; external; (*----------------------------------------------------------------*) type - { I do prefer TRGBColor but... oh well... } - RGB_Color = record - Red, - Green, - Blue, - Alpha : Byte; + rgb_Color = record + red, + green, + blue, + alpha : Byte; end; (*----------------------------------------------------------------*) var -{const} - //extern const rgb_color B_TRANSPARENT_COLOR; - B_TRANSPARENT_COLOR : RGB_Color; cvar; external; - //extern const uint8 B_TRANSPARENT_MAGIC_CMAP8; + B_TRANSPARENT_COLOR : rgb_color; cvar; external; B_TRANSPARENT_MAGIC_CMAP8 : Byte; cvar; external; - //extern const uint16 B_TRANSPARENT_MAGIC_RGBA15; B_TRANSPARENT_MAGIC_RGBA15 : Word; cvar; external; - //extern const uint16 B_TRANSPARENT_MAGIC_RGBA15_BIG; B_TRANSPARENT_MAGIC_RGBA15_BIG : Word; cvar; external; - //extern const uint32 B_TRANSPARENT_MAGIC_RGBA32; B_TRANSPARENT_MAGIC_RGBA32 : Cardinal; cvar; external; - //extern const uint32 B_TRANSPARENT_MAGIC_RGBA32_BIG; B_TRANSPARENT_MAGIC_RGBA32_BIG : Cardinal; cvar; external; - //extern const uint8 B_TRANSPARENT_8_BIT; + 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 - - Color_Map = record - ID : Integer; // int32 - ColorList: array [0..255] of RGB_Color; - InversionMap : array [0..255] of Byte; // uint8 - IndexMap : array [0..32767] of Byte; // uint8 + color_map = record + id : Longint; + color_list: array [0..255] of rgb_color; + inversion_map : array [0..255] of Byte; + index_map : array [0..32767] of Byte; end; - { TOverlayRectLimits = overlay_rect_limits } - OverlayRectLimits = record - HorizontalAlignment, - VerticalAlignment, - WidthAlignment, - HeightAlignment, - MinWidth, - MaxWidth, - MinHeight, - MaxHeight : Word; // uint16 - Reserved : array [0..7] of Cardinal; // uint32 + 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 Longword; end; - { TOverlayRestrictions = overlay_restrictions } - OverlayRestrictions = record - Source, - Destination : OverlayRectLimits; - MinWidthScale, - MaxWidthScale, - MinHeightScale, - MaxHeightScale : Double; // float - Reserved : array [0..7] of Cardinal; // uint32 + overlay_restrictions = record + source, + destination : overlay_rect_limits; + min_width_scale, + max_width_scale, + min_height_scale, + max_height_scale : Single; + reserved : array [0..7] of Longword; end; (*----------------------------------------------------------------*) - -//struct screen_id { int32 id; }; - Screen_ID = record - ID : Integer + screen_id = record + id : Longint; end; -//extern const struct screen_id B_MAIN_SCREEN_ID; var -{const} - B_MAIN_SCREEN_ID : Screen_ID; cvar; external; + B_MAIN_SCREEN_ID : screen_id; cvar; external; (*----------------------------------------------------------------*) type - - Color_Space = Cardinal; // or is just word? + color_space = Cardinal; 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) - B_RGB32 = $0008; // B[7:0] G[7:0] R[7:0] -[7:0] - B_RGBA32 = $2008; // B[7:0] G[7:0] R[7:0] A[7:0] - B_RGB24 = $0003; // B[7:0] G[7:0] R[7:0] - B_RGB16 = $0005; // G[2:0],B[4:0] R[4:0],G[5:3] - B_RGB15 = $0010; // G[2:0],B[4:0] -[0],R[4:0],G[4:3] - B_RGBA15 = $2010; // G[2:0],B[4:0] A[0],R[4:0],G[4:3] - B_CMAP8 = $0004; // D[7:0] - B_GRAY8 = $0002; // Y[7:0] - B_GRAY1 = $0001; // Y0[0],Y1[0],Y2[0],Y3[0],Y4[0],Y5[0],Y6[0],Y7[0] + // linear color space (little endian is the default) + B_RGB32 = $0008; // B[7:0] G[7:0] R[7:0] -[7:0] + B_RGBA32 = $2008; // B[7:0] G[7:0] R[7:0] A[7:0] + B_RGB24 = $0003; // B[7:0] G[7:0] R[7:0] + B_RGB16 = $0005; // G[2:0],B[4:0] R[4:0],G[5:3] + B_RGB15 = $0010; // G[2:0],B[4:0] -[0],R[4:0],G[4:3] + B_RGBA15 = $2010; // G[2:0],B[4:0] A[0],R[4:0],G[4:3] + B_CMAP8 = $0004; // D[7:0] + B_GRAY8 = $0002; // Y[7:0] + B_GRAY1 = $0001; // Y0[0],Y1[0],Y2[0],Y3[0],Y4[0],Y5[0],Y6[0],Y7[0] - // big endian version, when the encoding is not endianess independant - B_RGB32_BIG = $1008; // -[7:0] R[7:0] G[7:0] B[7:0] - B_RGBA32_BIG = $3008; // A[7:0] R[7:0] G[7:0] B[7:0] - B_RGB24_BIG = $1003; // R[7:0] G[7:0] B[7:0] - B_RGB16_BIG = $1005; // R[4:0],G[5:3] G[2:0],B[4:0] - B_RGB15_BIG = $1010; // -[0],R[4:0],G[4:3] G[2:0],B[4:0] - B_RGBA15_BIG = $3010; // A[0],R[4:0],G[4:3] G[2:0],B[4:0] + // big endian version, when the encoding is not endianess independant + B_RGB32_BIG = $1008; // -[7:0] R[7:0] G[7:0] B[7:0] + B_RGBA32_BIG = $3008; // A[7:0] R[7:0] G[7:0] B[7:0] + B_RGB24_BIG = $1003; // R[7:0] G[7:0] B[7:0] + B_RGB16_BIG = $1005; // R[4:0],G[5:3] G[2:0],B[4:0] + B_RGB15_BIG = $1010; // -[0],R[4:0],G[4:3] G[2:0],B[4:0] + B_RGBA15_BIG = $3010; // A[0],R[4:0],G[4:3] G[2:0],B[4:0] - // little-endian declarations, for completness - B_RGB32_LITTLE = B_RGB32; - B_RGBA32_LITTLE = B_RGBA32; - B_RGB24_LITTLE = B_RGB24; - B_RGB16_LITTLE = B_RGB16; - B_RGB15_LITTLE = B_RGB15; - B_RGBA15_LITTLE = B_RGBA15; + // little-endian declarations, for completness + B_RGB32_LITTLE = B_RGB32; + B_RGBA32_LITTLE = B_RGBA32; + B_RGB24_LITTLE = B_RGB24; + B_RGB16_LITTLE = B_RGB16; + B_RGB15_LITTLE = B_RGB15; + B_RGBA15_LITTLE = B_RGBA15; - // non linear color space -- note that these are here for exchange purposes; - // a BBitmap or BView may not necessarily support all these color spaces. + // non linear color space -- note that these are here for exchange purposes; + // a BBitmap or BView may not necessarily support all these color spaces. - // Loss/Saturation points are Y 16-235 (absoulte); Cb/Cr 16-240 (center 128) + // Loss/Saturation points are Y 16-235 (absoulte); Cb/Cr 16-240 (center 128) - B_YCbCr422 = $4000; // Y0[7:0] Cb0[7:0] Y1[7:0] Cr0[7:0] Y2[7:0]... - // Cb2[7:0] Y3[7:0] Cr2[7:0] - B_YCbCr411 = $4001; // Cb0[7:0] Y0[7:0] Cr0[7:0] Y1[7:0] Cb4[7:0]... - // Y2[7:0] Cr4[7:0] Y3[7:0] Y4[7:0] Y5[7:0]... - // Y6[7:0] Y7[7:0] - B_YCbCr444 = $4003; // Y0[7:0] Cb0[7:0] Cr0[7:0] - B_YCbCr420 = $4004; // Non-interlaced only, Cb0 Y0 Y1 Cb2 Y2 Y3 on even scan lines ... - // Cr0 Y0 Y1 Cr2 Y2 Y3 on odd scan lines + B_YCbCr422 = $4000; // Y0[7:0] Cb0[7:0] Y1[7:0] Cr0[7:0] Y2[7:0]... + // Cb2[7:0] Y3[7:0] Cr2[7:0] + B_YCbCr411 = $4001; // Cb0[7:0] Y0[7:0] Cr0[7:0] Y1[7:0] Cb4[7:0]... + // Y2[7:0] Cr4[7:0] Y3[7:0] Y4[7:0] Y5[7:0]... + // Y6[7:0] Y7[7:0] + B_YCbCr444 = $4003; // Y0[7:0] Cb0[7:0] Cr0[7:0] + B_YCbCr420 = $4004; // Non-interlaced only, Cb0 Y0 Y1 Cb2 Y2 Y3 on even scan lines ... + // Cr0 Y0 Y1 Cr2 Y2 Y3 on odd scan lines - // Extrema points are Y 0 - 207 (absolute) U -91 - 91 (offset 128) V -127 - 127 (offset 128) - // note that YUV byte order is different from YCbCr - // USE YCbCr, not YUV, when that's what you mean! - B_YUV422 = $4020; // U0[7:0] Y0[7:0] V0[7:0] Y1[7:0] ... - // U2[7:0] Y2[7:0] V2[7:0] Y3[7:0] - B_YUV411 = $4021; // U0[7:0] Y0[7:0] Y1[7:0] V0[7:0] Y2[7:0] Y3[7:0] - // U4[7:0] Y4[7:0] Y5[7:0] V4[7:0] Y6[7:0] Y7[7:0] - B_YUV444 = $4023; // U0[7:0] Y0[7:0] V0[7:0] U1[7:0] Y1[7:0] V1[7:0] - B_YUV420 = $4024; // Non-interlaced only, U0 Y0 Y1 U2 Y2 Y3 on even scan lines ... - // V0 Y0 Y1 V2 Y2 Y3 on odd scan lines - B_YUV9 = $402C; // planar? 410? - B_YUV12 = $402D; // planar? 420? + // Extrema points are Y 0 - 207 (absolute) U -91 - 91 (offset 128) V -127 - 127 (offset 128) + // note that YUV byte order is different from YCbCr + // USE YCbCr, not YUV, when that's what you mean! + B_YUV422 = $4020; // U0[7:0] Y0[7:0] V0[7:0] Y1[7:0] ... + // U2[7:0] Y2[7:0] V2[7:0] Y3[7:0] + B_YUV411 = $4021; // U0[7:0] Y0[7:0] Y1[7:0] V0[7:0] Y2[7:0] Y3[7:0] + // U4[7:0] Y4[7:0] Y5[7:0] V4[7:0] Y6[7:0] Y7[7:0] + B_YUV444 = $4023; // U0[7:0] Y0[7:0] V0[7:0] U1[7:0] Y1[7:0] V1[7:0] + B_YUV420 = $4024; // Non-interlaced only, U0 Y0 Y1 U2 Y2 Y3 on even scan lines ... + // V0 Y0 Y1 V2 Y2 Y3 on odd scan lines + B_YUV9 = $402C; // planar? 410? + B_YUV12 = $402D; // planar? 420? - B_UVL24 = $4030; // U0[7:0] V0[7:0] L0[7:0] ... - B_UVL32 = $4031; // U0[7:0] V0[7:0] L0[7:0] X0[7:0]... - B_UVLA32 = $6031; // U0[7:0] V0[7:0] L0[7:0] A0[7:0]... + B_UVL24 = $4030; // U0[7:0] V0[7:0] L0[7:0] ... + B_UVL32 = $4031; // U0[7:0] V0[7:0] L0[7:0] X0[7:0]... + B_UVLA32 = $6031; // U0[7:0] V0[7:0] L0[7:0] A0[7:0]... - B_LAB24 = $4032; // L0[7:0] a0[7:0] b0[7:0] ... (a is not alpha!) - B_LAB32 = $4033; // L0[7:0] a0[7:0] b0[7:0] X0[7:0] ... (b is not alpha!) - B_LABA32 = $6033; // L0[7:0] a0[7:0] b0[7:0] A0[7:0] ... (A is alpha) + B_LAB24 = $4032; // L0[7:0] a0[7:0] b0[7:0] ... (a is not alpha!) + B_LAB32 = $4033; // L0[7:0] a0[7:0] b0[7:0] X0[7:0] ... (b is not alpha!) + B_LABA32 = $6033; // L0[7:0] a0[7:0] b0[7:0] A0[7:0] ... (A is alpha) - // red is at hue = 0 - B_HSI24 = $4040; // H[7:0] S[7:0] I[7:0] - B_HSI32 = $4041; // H[7:0] S[7:0] I[7:0] X[7:0] - B_HSIA32 = $6041; // H[7:0] S[7:0] I[7:0] A[7:0] + // red is at hue = 0 + B_HSI24 = $4040; // H[7:0] S[7:0] I[7:0] + B_HSI32 = $4041; // H[7:0] S[7:0] I[7:0] X[7:0] + B_HSIA32 = $6041; // H[7:0] S[7:0] I[7:0] A[7:0] - B_HSV24 = $4042; // H[7:0] S[7:0] V[7:0] - B_HSV32 = $4043; // H[7:0] S[7:0] V[7:0] X[7:0] - B_HSVA32 = $6043; // H[7:0] S[7:0] V[7:0] A[7:0] + B_HSV24 = $4042; // H[7:0] S[7:0] V[7:0] + B_HSV32 = $4043; // H[7:0] S[7:0] V[7:0] X[7:0] + B_HSVA32 = $6043; // H[7:0] S[7:0] V[7:0] A[7:0] - B_HLS24 = $4044; // H[7:0] L[7:0] S[7:0] - B_HLS32 = $4045; // H[7:0] L[7:0] S[7:0] X[7:0] - B_HLSA32 = $6045; // H[7:0] L[7:0] S[7:0] A[7:0] + B_HLS24 = $4044; // H[7:0] L[7:0] S[7:0] + B_HLS32 = $4045; // H[7:0] L[7:0] S[7:0] X[7:0] + B_HLSA32 = $6045; // H[7:0] L[7:0] S[7:0] A[7:0] - B_CMY24 = $C001; // C[7:0] M[7:0] Y[7:0] No gray removal done - B_CMY32 = $C002; // C[7:0] M[7:0] Y[7:0] X[7:0] No gray removal done - B_CMYA32 = $E002; // C[7:0] M[7:0] Y[7:0] A[7:0] No gray removal done - B_CMYK32 = $C003; // C[7:0] M[7:0] Y[7:0] K[7:0] - - // compatibility declarations - B_MONOCHROME_1_BIT = B_GRAY1; - B_GRAYSCALE_8_BIT = B_GRAY8; - B_COLOR_8_BIT = B_CMAP8; - B_RGB_32_BIT = B_RGB32; - B_RGB_16_BIT = B_RGB15; - B_BIG_RGB_32_BIT = B_RGB32_BIG; - B_BIG_RGB_16_BIT = B_RGB15_BIG; + B_CMY24 = $C001; // C[7:0] M[7:0] Y[7:0] No gray removal done + B_CMY32 = $C002; // C[7:0] M[7:0] Y[7:0] X[7:0] No gray removal done + B_CMYA32 = $E002; // C[7:0] M[7:0] Y[7:0] A[7:0] No gray removal done + B_CMYK32 = $C003; // C[7:0] M[7:0] Y[7:0] K[7:0] + // compatibility declarations + B_MONOCHROME_1_BIT = B_GRAY1; + B_GRAYSCALE_8_BIT = B_GRAY8; + B_COLOR_8_BIT = B_CMAP8; + B_RGB_32_BIT = B_RGB32; + B_RGB_16_BIT = B_RGB15; + B_BIG_RGB_32_BIT = B_RGB32_BIG; + B_BIG_RGB_16_BIT = B_RGB15_BIG; // Find out whether a specific color space is supported by BBitmaps. // Support_flags will be set to what kinds of support are available. // If support_flags is set to 0, false will be returned. const + B_VIEWS_SUPPORT_DRAW_BITMAP = $1; + B_BITMAPS_SUPPORT_ATTACHED_VIEWS = $2; - B_VIEWS_SUPPORT_DRAW_BITMAP = $1; - B_BITMAPS_SUPPORT_ATTACHED_VIEWS = $2; - -// Check/Confirm This one, please. -function BitmapsSupportSpace(space : Color_Space; support_flags : PCardinal) - : 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); +function bitmaps_support_space(space : color_space; support_flags : PLongoword) + : Boolean; cdecl; external 'be' name 'bitmaps_support_space'; // "pixel_chunk" is the native increment from one pixel starting on an integral // 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, // whereas B_RGB24 sets pixel_chunk to 3, row_alignment to 4 and // pixels_per_chunk to 1. - -_IMPEXP_BE status_t get_pixel_size_for(color_space space, size_t * pixel_chunk, - size_t * row_alignment, size_t * pixels_per_chunk); -} +function get_pixel_size_for(space : color_space; var pixel_chunk : size_t; + var row_alignment : size_t; var pixels_per_chunk : size_t) + : status_t; cdecl; external 'be' name 'get_pixel_size_for'; (*----------------------------------------------------------------*) 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. - BufferLayout = (B_BUFFER_NONINTERLEAVED); // B_BUFFER_NONINTERLEAVED = 1 + buffer_layout = (unused_filler, + 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, - B_OP_SUBTRACT, B_OP_BLEND, B_OP_MIN, B_OP_MAX, - 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); + source_alpha = (B_PIXEL_ALPHA, B_CONSTANT_ALPHA); + alpha_function = (B_ALPHA_OVERLAY, B_ALPHA_COMPOSITE); const - B_8_BIT_640x480 = $00000001; B_8_BIT_800x600 = $00000002; B_8_BIT_1024x768 = $00000004; @@ -327,47 +264,10 @@ const // do not use B_FAKE_DEVICE--it will go away! B_FAKE_DEVICE = $40000000; - B_8_BIT_640x400 = $80000000; // (int) - - -(*---------------------------------------------------------------------------*) - -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'; + B_8_BIT_640x400 = $80000000; (*---------------------------------------------------------------------------*) implementation -end. +end. \ No newline at end of file diff --git a/bepascal/source/bepascal/pas/src/be/interface/interfacedefs.pp b/bepascal/source/bepascal/pas/src/be/interface/interfacedefs.pp index 2b198a5..c988eb0 100644 --- a/bepascal/source/bepascal/pas/src/be/interface/interfacedefs.pp +++ b/bepascal/source/bepascal/pas/src/be/interface/interfacedefs.pp @@ -32,18 +32,17 @@ type modifiers : Longword; key_states : array[0..15] of Byte; end; -{ + const - // TODO: widestring these - B_UTF8_ELLIPSIS = '$E2 $80 $A6'; - B_UTF8_OPEN_QUOTE = '$E2 $80 $9C'; - B_UTF8_CLOSE_QUOTE = '$E2 $80 $9D'; - B_UTF8_COPYRIGHT = '$C2 $A9'; - B_UTF8_REGISTERED = '$C2 $AE'; - B_UTF8_TRADEMARK = '$E2 $84 $A2'; - B_UTF8_SMILING_FACE = '$E2 $98 $BB'; - B_UTF8_HIROSHI = '$E5 $BC $98'; -} + B_UTF8_ELLIPSIS : WideString = #$E2 + #$80 + #$A6; + B_UTF8_OPEN_QUOTE : WideString = #$E2 + #$80 + #$9C; + B_UTF8_CLOSE_QUOTE : WideString = #$E2 + #$80 + #$9D; + B_UTF8_COPYRIGHT : WideString = #$C2 + #$A9; + B_UTF8_REGISTERED : WideString = #$C2 + #$AE; + B_UTF8_TRADEMARK : WideString = #$E2 + #$84 + #$A2; + B_UTF8_SMILING_FACE : WideString = #$E2 + #$98 + #$BB; + B_UTF8_HIROSHI : WideString = #$E5 + #$BC + #$98; + //---------------------------------------------------------------- const @@ -124,6 +123,7 @@ type dieresis_tables, tilde_tables : Longword; end; + Pkey_map = ^key_map; mouse_map = record left, @@ -143,12 +143,15 @@ type //---------------------------------------------------------------- -// duplicate 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, - B_BUTT_CAP = B_BUTT_JOIN, - B_SQUARE_CAP = B_SQUARE_JOIN); -} + 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; + const B_DEFAULT_MITER_LIMIT = 10.0; @@ -166,13 +169,14 @@ type alignment = (B_ALIGN_LEFT, B_ALIGN_RIGHT, B_ALIGN_CENTER); -(* - vertical_alignment = ( - B_ALIGN_TOP = 0x10L, - B_ALIGN_MIDDLE = 0x20, - B_ALIGN_BOTTOM = 0x30, - B_ALIGN_NO_VERTICAL = -1L); -*) +// vertical_alignment was an enum +type + vertical_alignment = Longint; +const + B_ALIGN_TOP : Longint = $10; + B_ALIGN_MIDDLE : Longint = $20; + B_ALIGN_BOTTOM : Longint = $30; + B_ALIGN_NO_VERTICAL : Longint = -1; //---------------------------------------------------------------- @@ -209,80 +213,118 @@ const //---------------------------------------------------------------- type - bitmap_tiling = (B_TILE_BITMAP_X, B_TILE_BITMAP_Y, B_TILE_BITMAP); -{ - overlay_options = ( - B_OVERLAY_FILTER_HORIZONTAL = 0x00010000, - B_OVERLAY_FILTER_VERTICAL = 0x00020000, - B_OVERLAY_MIRROR = 0x00040000, - B_OVERLAY_TRANSFER_CHANNEL = 0x00080000); -} +// overlay_options was an enum +type + overlay_options = Longword; +const + B_OVERLAY_FILTER_HORIZONTAL = $00010000; + 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 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 set_scroll_bar_info(info : scroll_bar_info) : status_t; cdecl; external 'be' name 'set_scroll_bar_info__FP15scroll_bar_info'; + function get_scroll_bar_info(info : scroll_bar_info) : status_t; + 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 set_mouse_type(mtype : Longint) : status_t; cdecl; external 'be' name 'set_mouse_type__Fl'; - function get_mouse_map(map : mouse_map) : status_t; cdecl; external 'be' name 'get_mouse_map__FP9mouse_map'; - function set_mouse_map(map : mouse_map) : status_t; cdecl; external 'be' name 'set_mouse_map__FP9mouse_map'; - function get_click_speed(speed : bigtime_t) : status_t; 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_mouse_type(mtype : Longint) : status_t; + cdecl; external 'be' name 'get_mouse_type__FPl'; + function set_mouse_type(mtype : Longint) : status_t; + cdecl; external 'be' name 'set_mouse_type__Fl'; + function get_mouse_map(map : mouse_map) : status_t; + cdecl; external 'be' name 'get_mouse_map__FP9mouse_map'; + function set_mouse_map(map : mouse_map) : status_t; + cdecl; external 'be' name 'set_mouse_map__FP9mouse_map'; + function get_click_speed(speed : bigtime_t) : status_t; + 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 set_key_repeat_rate(rate : Longint) : status_t; 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 get_key_repeat_rate(rate : Longint) : status_t; + cdecl; external 'be' name 'get_key_repeat_rate__FPl'; + function set_key_repeat_rate(rate : Longint) : status_t; + 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 get_key_info(var info : key_info) : status_t; cdecl; external 'be' name 'get_key_info__FP8key_info'; - //procedure get_key_map(key_map **map; char **key_buffer); cdecl; external 'be' name 'get_key_map__FPP7key_mapPPc'; - 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 get_key_info(var info : key_info) : status_t; + cdecl; external 'be' name 'get_key_info__FP8key_info'; + procedure get_key_map(var map : Pkey_map; var key_buffer : PChar); + cdecl; external 'be' name 'get_key_map__FPP7key_mapPPc'; + 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'; - procedure set_workspace_count(count : Longint); 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 count_workspaces : Longint; + cdecl; external 'be' name 'count_workspaces__Fv'; + procedure set_workspace_count(count : Longint); + 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'; - procedure run_select_printer_panel; 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_select_printer_panel; + 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 set_focus_follows_mouse(follow : Boolean); cdecl; external 'be' name 'set_focus_follows_mouse__Fb'; - function focus_follows_mouse : Boolean; cdecl; external 'be' name 'focus_follows_mouse__Fv'; + procedure set_focus_follows_mouse(follow : Boolean); + cdecl; external 'be' name 'set_focus_follows_mouse__Fb'; + function focus_follows_mouse : Boolean; + cdecl; external 'be' name 'focus_follows_mouse__Fv'; //---------------------------------------------------------------- type - mode_mouse = (B_NORMAL_MOUSE, // = 0 - B_FOCUS_FOLLOWS_MOUSE, // = 1 - bla, - B_WARP_MOUSE, // = 3 - blabla, - blablabla, - more_blablabla, - B_INSTANT_WARP_MOUSE); // = 7 + mode_mouse = ( + B_NORMAL_MOUSE, // = 0 + B_FOCUS_FOLLOWS_MOUSE, // = 1 + bla, + B_WARP_MOUSE, // = 3 + blabla, + blablabla, + more_blablabla, + B_INSTANT_WARP_MOUSE // = 7 + ); - procedure set_mouse_mode(mode : mode_mouse); cdecl; external 'be' name 'set_mouse_mode__F10mode_mouse'; - function mouse_mode : mode_mouse; cdecl; external 'be' name 'mouse_mode__Fv'; + procedure set_mouse_mode(mode : mode_mouse); + cdecl; external 'be' name 'set_mouse_mode__F10mode_mouse'; + function mouse_mode : mode_mouse; + cdecl; external 'be' name 'mouse_mode__Fv'; type // I re-ordered these to match BeAPI's values (BiPolar) @@ -294,20 +336,8 @@ type B_DESKTOP_COLOR, // 5 B_MENU_SELECTION_BACKGROUND_COLOR, // 6 B_MENU_ITEM_TEXT_COLOR, // 7 - 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; + B_MENU_SELECTED_ITEM_TEXT_COLOR // 8 + ); 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'; @@ -332,9 +362,8 @@ const implementation -Initialization - B_ROUND_CAP:=B_ROUND_JOIN; - B_BUTT_CAP:=B_BUTT_JOIN; - B_SQUARE_CAP:=B_SQUARE_JOIN; - -end. +initialization + B_ROUND_CAP := B_ROUND_JOIN; + B_BUTT_CAP := B_BUTT_JOIN; + B_SQUARE_CAP := B_SQUARE_JOIN; +end. \ No newline at end of file diff --git a/bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp b/bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp index 35a6b20..c5c65ab 100644 --- a/bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp +++ b/bepascal/source/bepascal/pas/src/be/interface/radiobutton.pp @@ -17,104 +17,128 @@ License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA } -unit radiobutton; +unit RadioButton; interface uses - beobj, Control, Message, Archivable, SupportDefs, Rect, Handler; + BeObj, Archivable, Control, Handler, Message, SupportDefs, Rect; type - BRadioButton = class(BControl) - private + BRadioButton = class(BControl) 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; destructor Destroy; override; 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 MouseDown(where : BPoint); override; procedure AttachedToWindow; override; - procedure KeyDown(bytes : PChar; numBytes : integer); override; - procedure SetValue(aValue : integer); - procedure GetPreferredSize(width : double; height : double); + procedure KeyDown(bytes : PChar; numBytes : Longint); override; + procedure SetValue(aValue : Longint); + procedure GetPreferredSize(width, height : Single); 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 WindowActivated(state : boolean); override; + procedure WindowActivated(state : Boolean); 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 FrameMoved(new_position : BPoint); override; - procedure FrameResized(new_width : double; new_height : double); override; - function ResolveSpecifier(msg : BMessage; index : integer; specifier : BMessage; form : integer; properti : PChar) : BHandler; - procedure MakeFocus(state : boolean); + procedure FrameResized(new_width, new_height : Single); override; + function ResolveSpecifier(msg : BMessage; index : Longint; + specifier : BMessage; form : Longint; + properti : PChar) : BHandler; + procedure MakeFocus(state : Boolean {$ifndef VER1_0}= true{$endif}); procedure AllAttached; override; procedure AllDetached; override; - function GetSupportedSuites(data : BMessage) : 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]; + function GetSupportedSuites(data : BMessage) : status_t; + function Perform(d : Perform_code; arg : Pointer) : status_t; end; function BRadioButton_Create(AObject : TBeObject; frame : TCPlusObject; - name, aLabel : PChar; message : TCPlusObject; - resizingMode, flags : Cardinal) : TCPlusObject; - cdecl; external BePascalLibName name 'BRadioButton_Create'; -function BRadioButton_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRadioButton_Create_1'; + name, aLabel : PChar; message : TCPlusObject; + resizingMode, flags : Longword) : TCPlusObject; + cdecl; external BePascalLibName name 'BRadioButton_Create'; +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_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Archive'; -procedure BRadioButton_Draw(AObject : TCPlusObject; updateRect : BRect); cdecl; external BePascalLibName name 'BRadioButton_Draw'; -procedure BRadioButton_MouseDown(AObject : TCPlusObject; where : BPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseDown'; -procedure BRadioButton_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AttachedToWindow'; -procedure BRadioButton_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BRadioButton_KeyDown'; -procedure BRadioButton_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BRadioButton_SetValue'; -procedure BRadioButton_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BRadioButton_GetPreferredSize'; -procedure BRadioButton_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_ResizeToPreferred'; -function BRadioButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : Status_t; cdecl; external BePascalLibName name 'BRadioButton_Invoke'; -procedure BRadioButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MessageReceived'; -procedure BRadioButton_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_WindowActivated'; -procedure BRadioButton_MouseUp(AObject : TCPlusObject; pt : BPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseUp'; -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 : double; new_height : double); 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'; -//procedure BRadioButton__ReservedRadioButton1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton1'; -//procedure BRadioButton__ReservedRadioButton2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton2'; -//function BRadioButton_operator=(AObject : TCPlusObject; : BRadioButton) : BRadioButton; cdecl; external BePascalLibName name 'BRadioButton_operator='; -//procedure BRadioButton_BBitmap *sBitmaps[2][3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_BBitmap *sBitmaps[2][3]'; -//procedure BRadioButton_bool fOutlined(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_bool fOutlined'; -//procedure BRadioButton_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_uint32 _reserved[2]'; +function BRadioButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject) + : BArchivable; cdecl; external BePascalLibName name 'BRadioButton_Instantiate'; +function BRadioButton_Archive(AObject : TCPlusObject; data : TCPlusObject; + deep : boolean) : status_t; + cdecl; external BePascalLibName name 'BRadioButton_Archive'; +procedure BRadioButton_Draw(AObject : TCPlusObject; updateRect : BRect); + cdecl; external BePascalLibName name 'BRadioButton_Draw'; +procedure BRadioButton_MouseDown(AObject : TCPlusObject; where : BPoint); + cdecl; external BePascalLibName name 'BRadioButton_MouseDown'; +procedure BRadioButton_AttachedToWindow(AObject : TCPlusObject); + cdecl; external BePascalLibName name 'BRadioButton_AttachedToWindow'; +procedure BRadioButton_KeyDown(AObject : TCPlusObject; bytes : PChar; + numBytes : integer); + cdecl; external BePascalLibName name 'BRadioButton_KeyDown'; +procedure BRadioButton_SetValue(AObject : TCPlusObject; value : integer); + cdecl; external BePascalLibName name 'BRadioButton_SetValue'; +procedure BRadioButton_GetPreferredSize(AObject : TCPlusObject; width, height : Single); + cdecl; external BePascalLibName name 'BRadioButton_GetPreferredSize'; +procedure BRadioButton_ResizeToPreferred(AObject : TCPlusObject); + cdecl; external BePascalLibName name 'BRadioButton_ResizeToPreferred'; +function BRadioButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : status_t; + cdecl; external BePascalLibName name 'BRadioButton_Invoke'; +procedure BRadioButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); + cdecl; external BePascalLibName name 'BRadioButton_MessageReceived'; +procedure BRadioButton_WindowActivated(AObject : TCPlusObject; state : Boolean); + cdecl; external BePascalLibName name 'BRadioButton_WindowActivated'; +procedure BRadioButton_MouseUp(AObject : TCPlusObject; pt : BPoint); + cdecl; external BePascalLibName name 'BRadioButton_MouseUp'; +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 -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 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; -constructor BRadioButton.Create(data : BMessage); +constructor BRadioButton.Create(data : BMessage); begin CreatePas; CPlusObject := BRadioButton_Create_1(Self, data.CPlusObject); end; -destructor BRadioButton.Destroy; +destructor BRadioButton.Destroy; begin BRadioButton_Free(CPlusObject); inherited; @@ -125,29 +149,29 @@ begin Result := BRadioButton_Instantiate(CPlusObject, data.CPlusObject); end; -function BRadioButton.Archive(data : BMessage; deep : boolean) : Status_t; +function BRadioButton.Archive(data : BMessage; deep : Boolean) : status_t; begin Result := BRadioButton_Archive(CPlusObject, data.CPlusObject, deep); end; procedure BRadioButton.Draw(updateRect : BRect); begin -// BRadioButton_Draw(CPlusObject, updateRect.CPlusObject); + BRadioButton_Draw(CPlusObject, updateRect.CPlusObject); end; procedure BRadioButton.MouseDown(where : BPoint); begin -// BRadioButton_MouseDown(CPlusObject, where.CPlusObject); + BRadioButton_MouseDown(CPlusObject, where.CPlusObject); end; procedure BRadioButton.AttachedToWindow; begin -// BRadioButton_AttachedToWindow(CPlusObject); + BRadioButton_AttachedToWindow(CPlusObject); end; procedure BRadioButton.KeyDown(bytes : PChar; numBytes : integer); begin -// BRadioButton_KeyDown(CPlusObject, bytes, numBytes); + BRadioButton_KeyDown(CPlusObject, bytes, numBytes); end; procedure BRadioButton.SetValue(aValue : integer); @@ -155,7 +179,7 @@ begin BRadioButton_SetValue(CPlusObject, aValue); end; -procedure BRadioButton.GetPreferredSize(width : double; height : double); +procedure BRadioButton.GetPreferredSize(width, height : Single); begin BRadioButton_GetPreferredSize(CPlusObject, width, height); end; @@ -165,44 +189,44 @@ begin BRadioButton_ResizeToPreferred(CPlusObject); end; -function BRadioButton.Invoke(msg : BMessage) : Status_t; +function BRadioButton.Invoke(msg : BMessage) : status_t; begin Result := BRadioButton_Invoke(CPlusObject, msg.CPlusObject); end; procedure BRadioButton.MessageReceived(msg : BMessage); begin -// BRadioButton_MessageReceived(CPlusObject, msg.CPlusObject); + BRadioButton_MessageReceived(CPlusObject, msg.CPlusObject); end; -procedure BRadioButton.WindowActivated(state : boolean); +procedure BRadioButton.WindowActivated(state : Boolean); begin -// BRadioButton_WindowActivated(CPlusObject, state); + BRadioButton_WindowActivated(CPlusObject, state); end; procedure BRadioButton.MouseUp(pt : BPoint); begin -// BRadioButton_MouseUp(CPlusObject, pt.CPlusObject); + BRadioButton_MouseUp(CPlusObject, pt.CPlusObject); end; -procedure BRadioButton.MouseMoved(pt : BPoint; code : Cardinal; msg : BMessage); +procedure BRadioButton.MouseMoved(pt : BPoint; code : Longword; msg : BMessage); begin -// BRadioButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); + BRadioButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); end; procedure BRadioButton.DetachedFromWindow; begin -// BRadioButton_DetachedFromWindow(CPlusObject); + BRadioButton_DetachedFromWindow(CPlusObject); end; procedure BRadioButton.FrameMoved(new_position : BPoint); begin -// BRadioButton_FrameMoved(CPlusObject, new_position.CPlusObject); + BRadioButton_FrameMoved(CPlusObject, new_position.CPlusObject); end; -procedure BRadioButton.FrameResized(new_width : double; new_height : double); +procedure BRadioButton.FrameResized(new_width, new_height : Single); begin -// BRadioButton_FrameResized(CPlusObject, new_width, new_height); + BRadioButton_FrameResized(CPlusObject, new_width, new_height); end; 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); end; -procedure BRadioButton.MakeFocus(state : boolean); +procedure BRadioButton.MakeFocus(state : Boolean); begin BRadioButton_MakeFocus(CPlusObject, state); end; procedure BRadioButton.AllAttached; begin -// BRadioButton_AllAttached(CPlusObject); + BRadioButton_AllAttached(CPlusObject); end; procedure BRadioButton.AllDetached; begin -// BRadioButton_AllDetached(CPlusObject); + BRadioButton_AllDetached(CPlusObject); end; -function BRadioButton.GetSupportedSuites(data : BMessage) : Status_t; +function BRadioButton.GetSupportedSuites(data : BMessage) : status_t; begin Result := BRadioButton_GetSupportedSuites(CPlusObject, data.CPlusObject); end; -function BRadioButton.Perform(d : Perform_code; arg : Pointer) : Status_t; +function BRadioButton.Perform(d : Perform_code; arg : Pointer) : status_t; begin Result := BRadioButton_Perform(CPlusObject, d, arg); 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. \ No newline at end of file diff --git a/bepascal/source/bepascal/pas/src/be/interface/rect.pp b/bepascal/source/bepascal/pas/src/be/interface/rect.pp index d1d7060..a2ca763 100644 --- a/bepascal/source/bepascal/pas/src/be/interface/rect.pp +++ b/bepascal/source/bepascal/pas/src/be/interface/rect.pp @@ -1,5 +1,5 @@ -{ BePascal - A pascal wrapper around the BeOS API - Copyright (C) 2002 Olivier Coursiere +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002-2003 Olivier Coursiere This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -15,124 +15,162 @@ License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA } - -unit rect; +unit Rect; interface uses - beobj; + BeObj; type - BRect =class; + BRect = class; BPoint = class(TBeObject) public constructor Create; override; - constructor Create(x, y : single); virtual; - constructor Create(point : BPoint); virtual; + constructor Create(x, y : Single); virtual; + constructor Create(point : BPoint); virtual; destructor Destroy; override; procedure ConstrainTo(Rect : BRect); procedure PrintToStream; - procedure Sept(x, y : single); + procedure Sept(x, y : Single); 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) private - function Get_Left : single; - function Get_Right : single; - function Get_bottom : single; - function Get_top : single; + function Get_Left : Single; + function Get_Right : Single; + function Get_bottom : Single; + function Get_top : Single; public constructor Create; override; 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; destructor Destroy; override; procedure PrintToStream; - - procedure SetLeftTop(Rect : TCPlusObject; p : BPoint); - procedure SetRightBottom(Rect : TCPlusObject; p : BPoint); - procedure SetLeftBottom(Rect : TCPlusObject; p : BPoint); - procedure SetRightTop(Rect : TCPlusObject; p : BPoint); + + procedure SetLeftTop(Rect : TCPlusObject; p : BPoint); + procedure SetRightBottom(Rect : TCPlusObject; p : BPoint); + procedure SetLeftBottom(Rect : TCPlusObject; p : BPoint); + procedure SetRightTop(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; dx,dy : single); + procedure OffSetBy(Rect : TCPlusObject; dx, dy : Single); procedure OffsetTo(Rect : TCPlusObject; p : BPoint); - procedure OffSetTo(Rect : TCPlusObject; dx,dy : single); - function InsetBySelf(Rect : TCPlusObject; p : BPoint): BRect; - function InsetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; - function InsetByCopy(Rect : TCPlusObject; p : BPoint): BRect; - function InsetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; - function OffSetBySelf(Rect : TCPlusObject; p : BPoint): BRect; - function OffSetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; - function OffSetByCopy(Rect : TCPlusObject; p : BPoint): BRect; - function OffSetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; - function OffSetToSelf(Rect : TCPlusObject; p : BPoint): BRect; - function OffSetToSelf(Rect : TCPlusObject; dx,dy :single): BRect; - function OffSetToCopy(Rect : TCPlusObject; p : BPoint): BRect; - function OffSetToCopy(Rect : TCPlusObject; dx,dy :single): BRect; - function Intersects(Rect : TCPlusObject; p : Brect): boolean; - function Contains(Rect : TCPlusObject; p : BPoint): boolean; - function Contains(Rect : TCPlusObject; p : Brect): boolean; - - - property left : single read Get_left; - property right : single read Get_right; - property bottom : single read Get_bottom; - property top : single read Get_top; + procedure OffSetTo(Rect : TCPlusObject; dx, dy : Single); + function InsetBySelf(Rect : TCPlusObject; p : BPoint) : BRect; + function InsetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect; + function InsetByCopy(Rect : TCPlusObject; p : BPoint) : BRect; + function InsetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect; + function OffSetBySelf(Rect : TCPlusObject; p : BPoint) : BRect; + function OffSetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect; + function OffSetByCopy(Rect : TCPlusObject; p : BPoint) : BRect; + function OffSetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect; + function OffSetToSelf(Rect : TCPlusObject; p : BPoint): BRect; + function OffSetToSelf(Rect : TCPlusObject; dx, dy :single): BRect; + function OffSetToCopy(Rect : TCPlusObject; p : BPoint) : BRect; + function OffSetToCopy(Rect : TCPlusObject; dx, dy : Single) : BRect; + function Intersects(Rect : TCPlusObject; p : BRect) : Boolean; + function Contains(Rect : TCPlusObject; p : BPoint) : Boolean; + function Contains(Rect : TCPlusObject; p : BRect) : Boolean; + + property left : Single read Get_left; + property right : Single read Get_right; + property bottom : Single read Get_bottom; + property top : Single read Get_top; end; -function BRect_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_1'; -function BRect_Create(AObject : TBeObject; rect : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_2'; -function BRect_Create(AObject : TBeObject; l, t, r, b : single) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_3'; -function BRect_Create(AObject : TBeObject; leftTop, rightBottom : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_4'; -procedure BRect_Free(rect : TCPlusObject); cdecl; external BePascalLibName name 'BRect_Free'; -procedure BRect_PrintToStream(Rect : TCPlusObject); cdecl; external bePascalLibName name 'BRect_PrintToStream'; -function BRect_left(Rect : TCPlusObject): single; cdecl; external bePascalLibName name 'BRect_left'; -function BRect_right(Rect : TCPlusObject): single; cdecl; external bePascalLibName name 'BRect_right'; -function BRect_bottom(Rect : TCPlusObject): single; cdecl; external bePascalLibName name 'BRect_bottom'; -function BRect_top(Rect : TCPlusObject): single; cdecl; external bePascalLibName name 'BRect_top'; +function BRect_Create(AObject : TBeObject) : TCPlusObject; + cdecl; external BePascalLibName name 'BRect_Create_1'; +function BRect_Create(AObject : TBeObject; rect : TCPlusObject) : TCPlusObject; + cdecl; external BePascalLibName name 'BRect_Create_2'; +function BRect_Create(AObject : TBeObject; l, t, r, b : Single) : TCPlusObject; + cdecl; external BePascalLibName name 'BRect_Create_3'; +function BRect_Create(AObject : TBeObject; leftTop, rightBottom : TCPlusObject) + : TCPlusObject; cdecl; external BePascalLibName name 'BRect_Create_4'; +procedure BRect_Free(rect : TCPlusObject); + cdecl; external BePascalLibName name 'BRect_Free'; -procedure BRect_SetLeftTop(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_SetLeftTop'; -procedure BRect_SetRightBottom(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_SetRightBottom'; -procedure BRect_SetLeftBottom(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_SetLeftBottom'; -procedure BRect_SetRightTop(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_SetRightTop'; -procedure BRect_InsetBy(Rect : TCPlusObject; p : BPoint); cdecl; external bePascalLibName name 'BRect_InsetBy'; -procedure BRect_InsetBy(Rect : TCPlusObject; dx,dy : single); cdecl; external bePascalLibName name 'BRect_InsetBy_1'; -procedure BRect_OffsetBy(Rect : TCPlusObject; p : BPoint); 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'; +procedure BRect_PrintToStream(Rect : TCPlusObject); + cdecl; external bePascalLibName name 'BRect_PrintToStream'; +function BRect_left(Rect : TCPlusObject) : Single; + cdecl; external bePascalLibName name 'BRect_left'; +function BRect_right(Rect : TCPlusObject) : Single; + cdecl; external bePascalLibName name 'BRect_right'; +function BRect_bottom(Rect : TCPlusObject) : Single; + cdecl; external bePascalLibName name 'BRect_bottom'; +function BRect_top(Rect : TCPlusObject) : Single; + cdecl; external bePascalLibName name 'BRect_top'; +procedure BRect_SetLeftTop(Rect : TCPlusObject; p : BPoint); + cdecl; external bePascalLibName name 'BRect_SetLeftTop'; +procedure BRect_SetRightBottom(Rect : TCPlusObject; p : BPoint); + cdecl; external bePascalLibName name 'BRect_SetRightBottom'; +procedure BRect_SetLeftBottom(Rect : TCPlusObject; p : BPoint); + cdecl; external bePascalLibName name 'BRect_SetLeftBottom'; +procedure BRect_SetRightTop(Rect : TCPlusObject; p : BPoint); + cdecl; external bePascalLibName name 'BRect_SetRightTop'; +procedure BRect_InsetBy(Rect : TCPlusObject; p : BPoint); + cdecl; external bePascalLibName name 'BRect_InsetBy'; +procedure BRect_InsetBy(Rect : TCPlusObject; dx, dy : Single); + cdecl; external bePascalLibName name 'BRect_InsetBy_1'; +procedure BRect_OffsetBy(Rect : TCPlusObject; p : BPoint); + 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; 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) : TCPlusObject; cdecl; external BePascalLibName name 'BPoint_Create_3'; -procedure BPoint_Free(Point : TCPlusObject); 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'; +function BPoint_Create(AObject : TBeObject; x, y : single) : TCPlusObject; + 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) : TCPlusObject; + cdecl; external BePascalLibName name 'BPoint_Create_3'; +procedure BPoint_Free(Point : TCPlusObject); + 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 @@ -148,7 +186,7 @@ begin CPlusObject := BRect_Create(Self, rect.CPlusObject); end; -constructor BRect.Create(l, t, r, b : single); +constructor BRect.Create(l, t, r, b : Single); begin inherited Create; CPlusObject := BRect_Create(Self, l, t, r, b); @@ -171,155 +209,154 @@ begin BRect_PrintToStream(CPlusObject); end; -function Brect.Get_Left : single; +function BRect.Get_Left : Single; begin - 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); + Result := BRect_left(CPlusObject); end; - -procedure Brect.SetLeftTop(Rect : TCPlusObject; p : BPoint); +function BRect.Get_right : Single; begin - BRect_SetLeftTop(CPlusObject,p); + Result := BRect_right(CPlusObject); end; -procedure Brect.SetRightBottom(Rect : TCPlusObject; p : BPoint); +function BRect.Get_bottom : Single; begin - BRect_SetRightBottom(CPlusObject,p); + Result := BRect_bottom(CPlusObject); end; -procedure Brect.SetLeftBottom(Rect : TCPlusObject; p : BPoint); +function BRect.Get_top : Single; begin - BRect_SetLeftBottom(CPlusObject,p); + Result := BRect_top(CPlusObject); end; -procedure Brect.SetRightTop(Rect : TCPlusObject; p : BPoint); +procedure BRect.SetLeftTop(Rect : TCPlusObject; p : BPoint); begin - BRect_SetRightTop(CPlusObject,p); + BRect_SetLeftTop(CPlusObject, p); end; -procedure Brect.InsetBy(Rect : TCPlusObject; p : BPoint); +procedure BRect.SetRightBottom(Rect : TCPlusObject; p : BPoint); begin - BRect_InsetBy(CPlusObject,p); + BRect_SetRightBottom(CPlusObject, p); end; -procedure Brect.InsetBy(Rect : TCPlusObject; dx,dy : single); +procedure BRect.SetLeftBottom(Rect : TCPlusObject; p : BPoint); begin - BRect_InsetBy(CPlusObject,dx,dy); + BRect_SetLeftBottom(CPlusObject, p); end; -procedure Brect.OffsetBy(Rect : TCPlusObject; p : BPoint); +procedure BRect.SetRightTop(Rect : TCPlusObject; p : BPoint); begin - BRect_OffsetBy(CPlusObject,p); + BRect_SetRightTop(CPlusObject, p); end; -procedure Brect.OffSetBy(Rect : TCPlusObject; dx,dy : single); +procedure BRect.InsetBy(Rect : TCPlusObject; p : BPoint); begin - BRect_OffSetBy(CPlusObject,dx,dy); + BRect_InsetBy(CPlusObject, p); end; -procedure Brect.OffsetTo(Rect : TCPlusObject; p : BPoint); +procedure BRect.InsetBy(Rect : TCPlusObject; dx, dy : Single); begin - BRect_OffsetTo(CPlusObject,p); + BRect_InsetBy(CPlusObject, dx, dy); end; -procedure Brect.OffSetTo(Rect : TCPlusObject; dx,dy : single); +procedure BRect.OffsetBy(Rect : TCPlusObject; p : BPoint); begin - BRect_OffSetTo(CPlusObject,dx,dy); + BRect_OffsetBy(CPlusObject, p); end; -function Brect.InsetBySelf(Rect : TCPlusObject; p : BPoint): BRect; +procedure BRect.OffSetBy(Rect : TCPlusObject; dx, dy : Single); begin - result:=BRect_InsetBySelf(CPlusObject,p); + BRect_OffSetBy(CPlusObject, dx, dy); end; -function Brect.InsetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; +procedure BRect.OffsetTo(Rect : TCPlusObject; p : BPoint); begin - result:=BRect_InsetBySelf(CPlusObject,dx,dy); + BRect_OffsetTo(CPlusObject, p); end; -function Brect.InsetByCopy(Rect : TCPlusObject; p : BPoint): BRect; +procedure BRect.OffSetTo(Rect : TCPlusObject; dx, dy : Single); begin - result:=BRect_InsetByCopy(CPlusObject,p); + BRect_OffSetTo(CPlusObject, dx, dy); end; -function Brect.InsetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; +function BRect.InsetBySelf(Rect : TCPlusObject; p : BPoint) : BRect; begin - result:=BRect_InsetByCopy(CPlusObject,dx,dy); + Result := BRect_InsetBySelf(CPlusObject, p); end; -function Brect.OffSetBySelf(Rect : TCPlusObject; p : BPoint): BRect; +function BRect.InsetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect; begin - result:=BRect_OffSetBySelf(CPlusObject,p); + Result := BRect_InsetBySelf(CPlusObject, dx, dy); end; -function Brect.OffSetBySelf(Rect : TCPlusObject; dx,dy :single): BRect; +function BRect.InsetByCopy(Rect : TCPlusObject; p : BPoint) : BRect; begin - result:=BRect_OffSetBySelf(CPlusObject,dx,dy); + Result := BRect_InsetByCopy(CPlusObject, p); end; -function Brect.OffSetByCopy(Rect : TCPlusObject; p : BPoint): BRect; +function BRect.InsetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect; begin - result:=BRect_OffSetByCopy(CPlusObject,p); + Result := BRect_InsetByCopy(CPlusObject, dx, dy); end; -function Brect.OffSetByCopy(Rect : TCPlusObject; dx,dy :single): BRect; +function BRect.OffSetBySelf(Rect : TCPlusObject; p : BPoint) : BRect; begin - result:=BRect_OffSetByCopy(CPlusObject,dx,dy); + Result := BRect_OffSetBySelf(CPlusObject, p); end; -function Brect.OffSetToSelf(Rect : TCPlusObject; p : BPoint): BRect; +function BRect.OffSetBySelf(Rect : TCPlusObject; dx, dy : Single) : BRect; begin - result:=BRect_OffSetToSelf(CPlusObject,p); + Result := BRect_OffSetBySelf(CPlusObject, dx, dy); end; -function Brect.OffSetToSelf(Rect : TCPlusObject; dx,dy :single): BRect; +function BRect.OffSetByCopy(Rect : TCPlusObject; p : BPoint) : BRect; begin - result:=BRect_OffSetToSelf(CPlusObject,dx,dy); + Result := BRect_OffSetByCopy(CPlusObject, p); end; -function Brect.OffSetToCopy(Rect : TCPlusObject; p : BPoint): BRect; +function BRect.OffSetByCopy(Rect : TCPlusObject; dx, dy : Single) : BRect; begin - result:=BRect_OffSetToCopy(CPlusObject,p); + Result := BRect_OffSetByCopy(CPlusObject, dx, dy); end; -function Brect.OffSetToCopy(Rect : TCPlusObject; dx,dy :single): BRect; +function BRect.OffSetToSelf(Rect : TCPlusObject; p : BPoint) : BRect; begin - result:=BRect_OffSetToCopy(CPlusObject,dx,dy); + Result := BRect_OffSetToSelf(CPlusObject,p); end; -function Brect.Intersects(Rect : TCPlusObject; p : Brect): boolean; +function BRect.OffSetToSelf(Rect : TCPlusObject; dx, dy : Single) : BRect; begin - result:=BRect_Intersects(CPlusObject,p); + Result := BRect_OffSetToSelf(CPlusObject, dx, dy); end; -function Brect.Contains(Rect : TCPlusObject; p : BPoint): boolean; +function BRect.OffSetToCopy(Rect : TCPlusObject; p : BPoint) : BRect; begin - result:=BRect_Contains(CPlusObject,p); + Result := BRect_OffSetToCopy(CPlusObject, p); end; -function Brect.Contains(Rect : TCPlusObject; p : Brect): boolean; +function BRect.OffSetToCopy(Rect : TCPlusObject; dx, dy : Single) : BRect; begin - result:=BRect_Contains(CPlusObject,p); + Result := BRect_OffSetToCopy(CPlusObject, dx, dy); end; +function BRect.Intersects(Rect : TCPlusObject; p : BRect) : Boolean; +begin + Result := BRect_Intersects(CPlusObject, p); +end; +function BRect.Contains(Rect : TCPlusObject; p : BPoint) : Boolean; +begin + Result := BRect_Contains(CPlusObject, p); +end; +function BRect.Contains(Rect : TCPlusObject; p : BRect) : Boolean; +begin + Result := BRect_Contains(CPlusObject, p); +end; // BPoint -constructor BPoint.Create(x, y : single); +constructor BPoint.Create(x, y : Single); begin inherited Create; CPlusObject := BPoint_Create(Self, x, y); @@ -353,13 +390,9 @@ begin BPoint_PrintToStream(CPlusObject); end; -procedure BPoint.Sept(x, y : single); +procedure BPoint.Sept(x, y : Single); begin BPoint_Set(CPlusObject, x, y); end; - - -initialization - -end. +end. \ No newline at end of file