mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-09 19:57:45 +01:00
carbon: implement GetObject for HPEN
git-svn-id: trunk@16816 -
This commit is contained in:
parent
0607f55e77
commit
e6b1fe55e0
@ -26,7 +26,7 @@ interface
|
||||
{$I carbondebug.inc}
|
||||
|
||||
uses
|
||||
// rtl+ftl
|
||||
// rtl+fcl
|
||||
Types, Classes, SysUtils, Math,
|
||||
// carbon bindings
|
||||
MacOSAll,
|
||||
@ -158,6 +158,7 @@ type
|
||||
private
|
||||
FR, FG, FB: Byte;
|
||||
FA: Boolean; // alpha: True - solid, False - clear
|
||||
function GetColorRef: TColorRef;
|
||||
public
|
||||
constructor Create(const AColor: TColor; ASolid, AGlobal: Boolean);
|
||||
procedure SetColor(const AColor: TColor; ASolid: Boolean);
|
||||
@ -165,6 +166,7 @@ type
|
||||
function CreateCGColor: CGColorRef;
|
||||
|
||||
property Solid: Boolean read FA;
|
||||
property ColorRef: TColorRef read GetColorRef;
|
||||
end;
|
||||
|
||||
{ TCarbonBrush }
|
||||
@ -1193,6 +1195,11 @@ end;
|
||||
|
||||
{ TCarbonColorObject }
|
||||
|
||||
function TCarbonColorObject.GetColorRef: TColorRef;
|
||||
begin
|
||||
Result := RGBToColor(FR, FG, FB);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCarbonColorObject.Create
|
||||
Params: AColor - Color
|
||||
|
||||
@ -1444,6 +1444,7 @@ var
|
||||
AObject: TCarbonGDIObject;
|
||||
DIB: TDIBSection;
|
||||
Width, Height: Integer;
|
||||
ALogPen: PLogPen absolute Buf;
|
||||
begin
|
||||
Result := 0;
|
||||
|
||||
@ -1502,7 +1503,21 @@ begin
|
||||
end;
|
||||
end
|
||||
else
|
||||
DebugLn('TCarbonWidgetSet.GetObject Font, Brush, Pen TODO');
|
||||
if AObject is TCarbonPen then
|
||||
begin
|
||||
if Buf = nil then
|
||||
Result := SizeOf(TLogPen)
|
||||
else
|
||||
if BufSize = SizeOf(TLogPen) then
|
||||
begin
|
||||
Result := SizeOf(TLogPen);
|
||||
ALogPen^.lopnStyle := TCarbonPen(AObject).Style;
|
||||
ALogPen^.lopnWidth := Types.Point(TCarbonPen(AObject).Width, 0);
|
||||
ALogPen^.lopnColor := TCarbonPen(AObject).ColorRef;
|
||||
end;
|
||||
end
|
||||
else
|
||||
DebugLn('TCarbonWidgetSet.GetObject Font, Brush TODO');
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user