From e7a1321eda2df9111a5f6c43d1da6f40175fedc5 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Tue, 5 Sep 2023 16:13:31 +0200 Subject: [PATCH] Inline interface. --- .../ServiceManagementFunctions.java | 41 ------------------- ...iceManagementApplicationLoginRegistry.java | 23 ++++++++++- 2 files changed, 22 insertions(+), 42 deletions(-) delete mode 100644 binding/src/main/java/ch/cyberduck/binding/foundation/ServiceManagementFunctions.java diff --git a/binding/src/main/java/ch/cyberduck/binding/foundation/ServiceManagementFunctions.java b/binding/src/main/java/ch/cyberduck/binding/foundation/ServiceManagementFunctions.java deleted file mode 100644 index 3a720e45869..00000000000 --- a/binding/src/main/java/ch/cyberduck/binding/foundation/ServiceManagementFunctions.java +++ /dev/null @@ -1,41 +0,0 @@ -package ch.cyberduck.binding.foundation; - -/* - * Copyright (c) 2002-2015 David Kocher. All rights reserved. - * http://cyberduck.ch/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Bug fixes, suggestions and comments should be sent to feedback@cyberduck.ch - */ - -import org.rococoa.internal.RococoaTypeMapper; - -import java.util.Collections; - -import com.sun.jna.Library; -import com.sun.jna.Native; - -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); -} diff --git a/core/dylib/src/main/java/ch/cyberduck/core/preferences/ServiceManagementApplicationLoginRegistry.java b/core/dylib/src/main/java/ch/cyberduck/core/preferences/ServiceManagementApplicationLoginRegistry.java index 5c5d143a2f5..94d5539eba1 100644 --- a/core/dylib/src/main/java/ch/cyberduck/core/preferences/ServiceManagementApplicationLoginRegistry.java +++ b/core/dylib/src/main/java/ch/cyberduck/core/preferences/ServiceManagementApplicationLoginRegistry.java @@ -17,7 +17,6 @@ * 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; @@ -25,6 +24,12 @@ 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); @@ -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); + } }