mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 09:40:28 +02:00
cocoa: move ScreenContext to CocoaGDIObjects, always create it since it is used by any LCL application
git-svn-id: trunk@38880 -
This commit is contained in:
parent
89930bd828
commit
ad804864bd
@ -435,6 +435,7 @@ var
|
||||
DefaultPen: TCocoaPen;
|
||||
DefaultFont: TCocoaFont;
|
||||
DefaultBitmap: TCocoaBitmap;
|
||||
ScreenContext: TCocoaContext;
|
||||
|
||||
function CheckDC(dc: HDC): TCocoaContext;
|
||||
function CheckDC(dc: HDC; Str: string): Boolean;
|
||||
@ -1330,6 +1331,7 @@ begin
|
||||
FRegion := TCocoaRegion.CreateDefault;
|
||||
FRegion.AddRef;
|
||||
FClipRegion := FRegion;
|
||||
FSavedDCList := nil;
|
||||
FText := TCocoaTextLayout.Create;
|
||||
FClipped := False;
|
||||
end;
|
||||
@ -2591,10 +2593,13 @@ initialization
|
||||
DefaultPen := TCocoaPen.CreateDefault;
|
||||
DefaultFont := TCocoaFont.CreateDefault;
|
||||
DefaultBitmap := TCocoaBitmap.CreateDefault;
|
||||
ScreenContext := TCocoaContext.Create;
|
||||
|
||||
finalization
|
||||
ScreenContext.Free;
|
||||
DefaultBrush.Free;
|
||||
DefaultPen.Free;
|
||||
DefaultFont.Free;
|
||||
DefaultBitmap.Free;
|
||||
|
||||
end.
|
||||
|
@ -141,9 +141,6 @@ implementation
|
||||
uses
|
||||
CocoaCaret;
|
||||
|
||||
var
|
||||
ScreenContext : TCocoaContext = nil;
|
||||
|
||||
// the implementation of the utility methods
|
||||
{$I cocoaobject.inc}
|
||||
// the implementation of the winapi compatibility methods
|
||||
|
@ -448,7 +448,6 @@ end;
|
||||
|
||||
procedure InternalFinal;
|
||||
begin
|
||||
if Assigned(ScreenContext) then ScreenContext.Free;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -1303,11 +1303,8 @@ function TCocoaWidgetSet.GetDC(hWnd: HWND): HDC;
|
||||
var
|
||||
ctx: TCocoaContext;
|
||||
begin
|
||||
if hWnd=0 then
|
||||
begin
|
||||
if not Assigned(ScreenContext) then ScreenContext:=TCocoaContext.Create;
|
||||
Result:=HDC(ScreenContext);
|
||||
end
|
||||
if hWnd = 0 then
|
||||
Result := HDC(ScreenContext)
|
||||
else
|
||||
begin
|
||||
// ToDo: Not finished yet
|
||||
|
@ -786,6 +786,7 @@ end;
|
||||
|
||||
function TLCLCommonCallback.DeliverMessage(var Msg): LRESULT;
|
||||
begin
|
||||
// WriteLn('Delivering message to target: ', PtrInt(Target), ' ', Target.ClassName);
|
||||
Result := LCLMessageGlue.DeliverMessage(Target, Msg);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user