mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 07:00:35 +02:00
carbon: added activate-deactivate application handling
git-svn-id: trunk@23885 -
This commit is contained in:
parent
b2d37865b0
commit
5a86113fc1
@ -268,6 +268,42 @@ begin
|
||||
Application.IntfAppMinimize;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Name: CarbonApp_Deactivated
|
||||
Handles application deactivation
|
||||
------------------------------------------------------------------------------}
|
||||
function CarbonApp_Deactivated(ANextHandler: EventHandlerCallRef;
|
||||
AEvent: EventRef;
|
||||
AWidget: TCarbonWidget): OSStatus; {$IFDEF darwin}mwpascal;{$ENDIF}
|
||||
begin
|
||||
{$IFDEF VerboseAppEvent}
|
||||
DebugLn('CarbonApp_Deactivate');
|
||||
{$ENDIF}
|
||||
|
||||
Result := CallNextEventHandler(ANextHandler, AEvent);
|
||||
|
||||
Application.IntfAppDeactivate;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Name: CarbonApp_Activated
|
||||
Handles application activation
|
||||
------------------------------------------------------------------------------}
|
||||
function CarbonApp_Activated(ANextHandler: EventHandlerCallRef;
|
||||
AEvent: EventRef;
|
||||
AWidget: TCarbonWidget): OSStatus; {$IFDEF darwin}mwpascal;{$ENDIF}
|
||||
begin
|
||||
{$IFDEF VerboseAppEvent}
|
||||
DebugLn('CarbonApp_Activate');
|
||||
{$ENDIF}
|
||||
|
||||
Result := CallNextEventHandler(ANextHandler, AEvent);
|
||||
|
||||
Application.IntfAppActivate;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Name: CarbonApp_Open
|
||||
Handles application open
|
||||
@ -989,7 +1025,15 @@ begin
|
||||
TmpSpec := MakeEventSpec(kEventClassApplication, kEventAppHidden);
|
||||
InstallApplicationEventHandler(RegisterEventHandler(@CarbonApp_Hidden),
|
||||
1, @TmpSpec, nil, nil);
|
||||
|
||||
|
||||
TmpSpec := MakeEventSpec(kEventClassApplication, kEventAppDeactivated);
|
||||
InstallApplicationEventHandler(RegisterEventHandler(@CarbonApp_Deactivated),
|
||||
1, @TmpSpec, nil, nil);
|
||||
|
||||
TmpSpec := MakeEventSpec(kEventClassApplication, kEventAppActivated);
|
||||
InstallApplicationEventHandler(RegisterEventHandler(@CarbonApp_Activated),
|
||||
1, @TmpSpec, nil, nil);
|
||||
|
||||
FOpenEventHandlerUPP := NewAEEventHandlerUPP(AEEventHandlerProcPtr(@CarbonApp_Open));
|
||||
FQuitEventHandlerUPP := NewAEEventHandlerUPP(AEEventHandlerProcPtr(@CarbonApp_Quit));
|
||||
OSError(
|
||||
|
Loading…
Reference in New Issue
Block a user