mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 09:59:17 +02:00
cocoa: fixed compilation x86_64
git-svn-id: trunk@42071 -
This commit is contained in:
parent
ffc02673d7
commit
5508274faf
@ -10,7 +10,7 @@ interface
|
||||
uses
|
||||
MacOSAll, // for CGContextRef
|
||||
LCLtype, LCLProc, Graphics, Controls,
|
||||
CocoaAll, CocoaUtils,
|
||||
CocoaAll, CocoaProc, CocoaUtils,
|
||||
SysUtils, Classes, Contnrs, Types, Math;
|
||||
|
||||
type
|
||||
@ -1660,7 +1660,7 @@ var
|
||||
begin
|
||||
if Style = bvRaised then
|
||||
begin
|
||||
GetThemeMetric(kThemeMetricPrimaryGroupBoxContentInset, D);
|
||||
GetHiThemeMetric(kThemeMetricPrimaryGroupBoxContentInset, D);
|
||||
|
||||
// draw frame as group box
|
||||
DrawInfo.version := 0;
|
||||
@ -1669,7 +1669,11 @@ begin
|
||||
|
||||
for I := 1 to FrameWidth do
|
||||
begin
|
||||
{$IFDEF NoCarbon}
|
||||
// ToDo
|
||||
{$ELSE}
|
||||
HIThemeDrawGroupBox(RectToCGRect(ARect), DrawInfo, CGContext, kHIThemeOrientationNormal);
|
||||
{$ENDIF}
|
||||
InflateRect(ARect, -D, -D);
|
||||
end;
|
||||
end;
|
||||
@ -1880,11 +1884,15 @@ procedure TCocoaContext.DrawFocusRect(ARect: TRect);
|
||||
var
|
||||
AOutSet: SInt32;
|
||||
begin
|
||||
{$IFDEF NoCarbon}
|
||||
// ToDo
|
||||
{$ELSE}
|
||||
// LCL thinks that focus cannot be drawn outside focus rects, but carbon do that
|
||||
// => correct rect
|
||||
GetThemeMetric(kThemeMetricFocusRectOutset, AOutSet);
|
||||
InflateRect(ARect, -AOutSet, -AOutSet);
|
||||
HIThemeDrawFocusRect(RectToCGRect(ARect), True, CGContext, kHIThemeOrientationNormal);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{ TCocoaRegion }
|
||||
|
@ -63,6 +63,7 @@ function QDStyleToFontStyle(QDStyle: Integer): TFontStyles;}
|
||||
|
||||
procedure FillStandardDescription(out Desc: TRawImageDescription);
|
||||
function GetHiThemeMetric(Metric: ThemeMetric; DefaultValue: Integer = 0): Integer;
|
||||
|
||||
{
|
||||
function CreateCustomHIView(const ARect: HIRect; ControlStyle: TControlStyle = []): HIViewRef;
|
||||
|
||||
@ -124,6 +125,8 @@ procedure RaiseColorSpaceError;
|
||||
procedure RaiseMemoryAllocationError;
|
||||
procedure RaiseContextCreationError;}
|
||||
|
||||
function GetCurrentEventTime: double;
|
||||
|
||||
implementation
|
||||
|
||||
//uses CarbonDbgConsts;
|
||||
@ -620,9 +623,21 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function GetHiThemeMetric(Metric: ThemeMetric; DefaultValue: Integer): Integer;
|
||||
begin
|
||||
{$IFDEF NoCarbon}
|
||||
// ToDo
|
||||
Result := DefaultValue;;
|
||||
{$ELSE}
|
||||
if GetThemeMetric(Metric, Result) <> noErr then
|
||||
Result := DefaultValue;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function GetCurrentEventTime: double;
|
||||
// returns seconds since system startup
|
||||
begin
|
||||
Result := AbsoluteToDuration(UpTime) / 1000.0;
|
||||
end;
|
||||
|
||||
(*
|
||||
{------------------------------------------------------------------------------
|
||||
Name: CreateCustomHIView
|
||||
|
@ -1424,15 +1424,35 @@ begin
|
||||
VK_CAPITAL:
|
||||
Result := ToggleMap[(Modifiers and NSAlphaShiftKeyMask) <> 0];
|
||||
VK_LBUTTON:
|
||||
{$IFDEF NoCarbon}
|
||||
Result:=DownMap[false]; // ToDo
|
||||
{$ELSE}
|
||||
Result := DownMap[(GetCurrentEventButtonState and $01) <> 0];
|
||||
{$ENDIF}
|
||||
VK_RBUTTON:
|
||||
{$IFDEF NoCarbon}
|
||||
Result:=DownMap[false]; // ToDo
|
||||
{$ELSE}
|
||||
Result := DownMap[(GetCurrentEventButtonState and $02) <> 0];
|
||||
{$ENDIF}
|
||||
VK_MBUTTON:
|
||||
{$IFDEF NoCarbon}
|
||||
Result:=DownMap[false]; // ToDo
|
||||
{$ELSE}
|
||||
Result := DownMap[(GetCurrentEventButtonState and $03) <> 0];
|
||||
{$ENDIF}
|
||||
VK_XBUTTON1:
|
||||
{$IFDEF NoCarbon}
|
||||
Result:=DownMap[false]; // ToDo
|
||||
{$ELSE}
|
||||
Result := DownMap[(GetCurrentEventButtonState and $04) <> 0];
|
||||
{$ENDIF}
|
||||
VK_XBUTTON2:
|
||||
{$IFDEF NoCarbon}
|
||||
Result:=DownMap[false]; // ToDo
|
||||
{$ELSE}
|
||||
Result := DownMap[(GetCurrentEventButtonState and $05) <> 0];
|
||||
{$ENDIF}
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
@ -47,6 +47,8 @@ else if LCLWidgetType='carbon' then begin
|
||||
IncPath := UnitPath;
|
||||
end else if LCLWidgetType='cocoa' then begin
|
||||
CustomOptions := '-dcocoa';
|
||||
if TargetCPU<>'i386' then
|
||||
CustomOptions += ' -dNoCarbon';
|
||||
end else if LCLWidgetType='wince' then begin
|
||||
CustomOptions := '-dDisableChecks';
|
||||
end else if LCLWidgetType='fpgui' then begin
|
||||
|
Loading…
Reference in New Issue
Block a user