Skip to content

Commit

Permalink
Inline interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Sep 5, 2023
1 parent e2ed514 commit e7a1321
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 42 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@
* Bug fixes, suggestions and comments should be sent to feedback@cyberduck.ch
*/

import ch.cyberduck.binding.foundation.ServiceManagementFunctions;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.local.Application;
import ch.cyberduck.core.local.FinderLocal;
import ch.cyberduck.core.local.LaunchServicesApplicationFinder;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.rococoa.internal.RococoaTypeMapper;

import java.util.Collections;

import com.sun.jna.Library;
import com.sun.jna.Native;

public class ServiceManagementApplicationLoginRegistry implements ApplicationLoginRegistry {
private static final Logger log = LogManager.getLogger(ServiceManagementApplicationLoginRegistry.class);
Expand Down Expand Up @@ -59,4 +64,20 @@ public boolean unregister(final Application application) {
}
return true;
}

public interface ServiceManagementFunctions extends Library {

ServiceManagementFunctions library = Native.load(
"ServiceManagement", ServiceManagementFunctions.class, Collections.singletonMap(Library.OPTION_TYPE_MAPPER, new RococoaTypeMapper()));

/**
* @param identifier The bundle identifier of the helper application bundle
* @param enabled The Boolean enabled state of the helper application. This value is effective only
* for the currently logged in user. If true, the helper application will be started
* immediately (and upon subsequent logins) and kept running. If false, the helper
* application will no longer be kept running.
* @return Returns true if the requested change has taken effect.
*/
boolean SMLoginItemSetEnabled(String identifier, boolean enabled);
}
}

0 comments on commit e7a1321

Please sign in to comment.