MeVisLab Toolbox Reference
macos::Application Class Reference

Application related functions. More...

#include <macApplication.h>

Public Types

enum  {
  ApplicationPresentationDefault = 0 , ApplicationPresentationAutoHideDock = (1 << 0) , ApplicationPresentationHideDock = (1 << 1) , ApplicationPresentationAutoHideMenuBar = (1 << 2) ,
  ApplicationPresentationHideMenuBar = (1 << 3)
}
 The constants control the presentation of the application. More...
 
enum  ActivationPolicy { ActivationPolicyRegular , ActivationPolicyAccessory , ActivationPolicyProhibited }
 Activation policies that control whether and how an app may be activated. More...
 
enum  {
  ActivityIdleDisplaySleepDisabled = (1 << 0) , ActivityIdleSystemSleepDisabled = (1 << 1) , ActivityAutomaticTerminationDisabled = (1 << 2) , ActivityUserInitiated = (1 << 3) ,
  ActivityBackground = (1 << 4)
}
 Application activity options. More...
 
typedef unsigned int PresentationOptions
 Application presentation options storage type. More...
 
typedef unsigned int ActivityOptions
 Activity options storage type. More...
 

Static Public Member Functions

static void indicateBusyState (const std::string &message=std::string())
 Show busy state indicator, possibly displaying a descriptive message (UTF8) More...
 
static void removeBusyStateIndicator ()
 Hide busy state indicator. More...
 
static void initializeCocoa ()
 Startup function to call when running Cocoa code from a Carbon application. More...
 
static void setPresentationOptions (PresentationOptions options)
 Sets the application presentation options to use when this application is active. Only certain combinations of “PresentationOptions” flags are supported. More...
 
static bool setActivationPolicy (ActivationPolicy policy)
 Attempts to modify the app's activation policy. More...
 
static bool isActive (pid_t pid=0)
 Returns a boolean value indicating whether the referenced application is currently frontmost (active) More...
 
static bool activate (pid_t pid=0, uint32_t timeout=800)
 Activate application and bring all process windows forward, timeout allows to wait for application to connect to window server (milliseconds) More...
 
static void enableSuddenTermination ()
 Enables the application for quick killing using sudden termination of Mac OS X 10.6 or later. More...
 
static void disableSuddenTermination ()
 Disables the application for quickly killing using sudden termination of Mac OS X 10.6 or later. More...
 
static void enableAutomaticTermination (const std::string &reason=std::string())
 Enables automatic termination for the application of Mac OS X 10.7 or later. More...
 
static void disableAutomaticTermination (const std::string &reason=std::string())
 Disables automatic termination for the application of Mac OS X 10.7 or later. More...
 
static void enableRelaunchOnLogin ()
 Enables relaunching the application on login of Mac OS X 10.7 or later. More...
 
static void disableRelaunchOnLogin ()
 Disables relaunching the application on login of Mac OS X 10.7 or later. More...
 
static void disableWindowRestoration ()
 Disables the window restoration of Mac OS X 10.7 or later. More...
 
static bool isAppearingDarkAqua ()
 Returns true if effective appearance of the App is Dark Aqua (macOS 10.14 or later) More...
 
static ApplicationActivityToken beginActivityWithOptions (ActivityOptions options, const std::string &reason=std::string())
 Begin an activity using the given options and reason. More...
 
static void endActivity (ApplicationActivityToken &token)
 Ends the given activity. More...
 

Detailed Description

Application related functions.

Definition at line 31 of file macApplication.h.

Member Typedef Documentation

◆ ActivityOptions

Activity options storage type.

Definition at line 114 of file macApplication.h.

◆ PresentationOptions

Application presentation options storage type.

Definition at line 63 of file macApplication.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The constants control the presentation of the application.

Enumerator
ApplicationPresentationDefault 

The application is displayed as normal, including dock and menu bar.

ApplicationPresentationAutoHideDock 

The dock is normally hidden, but automatically appears when moused near.

ApplicationPresentationHideDock 

The dock is entirely hidden and disabled.

ApplicationPresentationAutoHideMenuBar 

The menu bar is normally hidden, but automatically appears when moused near.

ApplicationPresentationHideMenuBar 

The menu bar is entirely hidden and disabled.

Definition at line 55 of file macApplication.h.

◆ anonymous enum

anonymous enum

Application activity options.

Enumerator
ActivityIdleDisplaySleepDisabled 

Used for activities that require the screen to stay powered on.

ActivityIdleSystemSleepDisabled 

Used for activities that require the computer to not idle sleep. This is included in ActivityUserInitiated.

ActivityAutomaticTerminationDisabled 

Prevents automatic termination. This is included in ActivityUserInitiated.

ActivityUserInitiated 

App is performing a user-requested action.

ActivityBackground 

App has initiated some kind of work, but not as the direct result of user request.

Definition at line 106 of file macApplication.h.

◆ ActivationPolicy

Activation policies that control whether and how an app may be activated.

Enumerator
ActivationPolicyRegular 

The application is an ordinary app that appears in the Dock and may have a user interface.

ActivationPolicyAccessory 

The application does not appear in the Dock and does not have a menu bar, but it may be activated programmatically or by clicking on one of its windows.

ActivationPolicyProhibited 

The application does not appear in the Dock and may not create windows or be activated.

Definition at line 69 of file macApplication.h.

Member Function Documentation

◆ activate()

static bool macos::Application::activate ( pid_t  pid = 0,
uint32_t  timeout = 800 
)
static

Activate application and bring all process windows forward, timeout allows to wait for application to connect to window server (milliseconds)

◆ beginActivityWithOptions()

static ApplicationActivityToken macos::Application::beginActivityWithOptions ( ActivityOptions  options,
const std::string &  reason = std::string() 
)
static

Begin an activity using the given options and reason.

◆ disableAutomaticTermination()

static void macos::Application::disableAutomaticTermination ( const std::string &  reason = std::string())
static

Disables automatic termination for the application of Mac OS X 10.7 or later.

◆ disableRelaunchOnLogin()

static void macos::Application::disableRelaunchOnLogin ( )
static

Disables relaunching the application on login of Mac OS X 10.7 or later.

◆ disableSuddenTermination()

static void macos::Application::disableSuddenTermination ( )
static

Disables the application for quickly killing using sudden termination of Mac OS X 10.6 or later.

◆ disableWindowRestoration()

static void macos::Application::disableWindowRestoration ( )
static

Disables the window restoration of Mac OS X 10.7 or later.

◆ enableAutomaticTermination()

static void macos::Application::enableAutomaticTermination ( const std::string &  reason = std::string())
static

Enables automatic termination for the application of Mac OS X 10.7 or later.

◆ enableRelaunchOnLogin()

static void macos::Application::enableRelaunchOnLogin ( )
static

Enables relaunching the application on login of Mac OS X 10.7 or later.

◆ enableSuddenTermination()

static void macos::Application::enableSuddenTermination ( )
static

Enables the application for quick killing using sudden termination of Mac OS X 10.6 or later.

◆ endActivity()

static void macos::Application::endActivity ( ApplicationActivityToken token)
static

Ends the given activity.

◆ indicateBusyState()

static void macos::Application::indicateBusyState ( const std::string &  message = std::string())
static

Show busy state indicator, possibly displaying a descriptive message (UTF8)

◆ initializeCocoa()

static void macos::Application::initializeCocoa ( )
static

Startup function to call when running Cocoa code from a Carbon application.

◆ isActive()

static bool macos::Application::isActive ( pid_t  pid = 0)
static

Returns a boolean value indicating whether the referenced application is currently frontmost (active)

◆ isAppearingDarkAqua()

static bool macos::Application::isAppearingDarkAqua ( )
static

Returns true if effective appearance of the App is Dark Aqua (macOS 10.14 or later)

◆ removeBusyStateIndicator()

static void macos::Application::removeBusyStateIndicator ( )
static

Hide busy state indicator.

◆ setActivationPolicy()

static bool macos::Application::setActivationPolicy ( ActivationPolicy  policy)
static

Attempts to modify the app's activation policy.

◆ setPresentationOptions()

static void macos::Application::setPresentationOptions ( PresentationOptions  options)
static

Sets the application presentation options to use when this application is active. Only certain combinations of “PresentationOptions” flags are supported.


The documentation for this class was generated from the following file: