Browse Source

MOS-8 Change pEpMacOSAdapterProtocol to PEPMacOSAdapterProtocol.

MOS-8
David Alarcon 5 months ago
parent
commit
4ebf75f450
8 changed files with 16 additions and 16 deletions
  1. +2
    -2
      README.md
  2. +4
    -4
      Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift
  3. +2
    -2
      pEpMacOSAdapter.xcodeproj/project.pbxproj
  4. +2
    -2
      pEpMacOSAdapter/PEPMacOSAdapterProtocol.h
  5. +1
    -1
      pEpMacOSAdapter/main.m
  6. +2
    -2
      pEpMacOSAdapter/pEpMacOSAdapter.h
  7. +2
    -2
      pEpMacOSAdapter/pEpMacOSAdapter.m
  8. +1
    -1
      pEpMacOSAdapter/pEpUpdater.h

+ 2
- 2
README.md View File

@ -117,9 +117,9 @@ The implementation is split in to parts:
1. the working code is in pEpMacOSAdapter; the implementation is in Objective C
1. the User Interface is in pEpNotifications; the implementation is in Swift
### pEpMacOSAdapterProtocol, implemented with XPC
### PEPMacOSAdapterProtocol, implemented with XPC
see [pEpMacOSAdapterProtocol.h](https://gitea.pep.foundation/fdik/pEpMacOSAdapter/src/branch/master/pEpMacOSAdapter/pEpMacOSAdapterProtocol.h)
see [PEPMacOSAdapterProtocol.h](https://gitea.pep.foundation/fdik/pEpMacOSAdapter/src/branch/master/pEpMacOSAdapter/PEPMacOSAdapterProtocol.h)
This protocol is provided to the User Interface to get informed when a download was happening.
When a subscription is active updateNow() can be used to search for immediate updates.

+ 4
- 4
Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift View File

@ -16,7 +16,7 @@ enum DNType : Int { case ready = 0, downloading, downloadArrived, noDownloadAvai
func notifyDownload(_ type: Int, withName: NSString, withFilename: NSString)
}
@objc(pEpMacOSAdapterProtocol) protocol pEpMacOSAdapterProtocol {
@objc(PEPMacOSAdapterProtocol) protocol PEPMacOSAdapterProtocol {
func subscribeForUpdate(_ endpoint: NSXPCListenerEndpoint?)
func unsubscribeForUpdate()
func updateNow()
@ -43,7 +43,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
var statusBarItem: NSStatusItem? = nil
lazy var connection: NSXPCConnection = NSXPCConnection.init(machServiceName: "foundation.pEp.adapter.macOS")
var service: pEpMacOSAdapterProtocol?
var service: PEPMacOSAdapterProtocol?
var nc = NSUserNotificationCenter.default
lazy var clientListener: NSXPCListener = NSXPCListener.anonymous()
var receiver: pEpNotification!
@ -233,9 +233,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
}
private func initXPCConnection() {
connection.remoteObjectInterface = NSXPCInterface.init(with: pEpMacOSAdapterProtocol.self)
connection.remoteObjectInterface = NSXPCInterface.init(with: PEPMacOSAdapterProtocol.self)
connection.resume()
service = connection.remoteObjectProxyWithErrorHandler(proxyErrorHandler) as? pEpMacOSAdapterProtocol
service = connection.remoteObjectProxyWithErrorHandler(proxyErrorHandler) as? PEPMacOSAdapterProtocol
}
private func initClientService() {


+ 2
- 2
pEpMacOSAdapter.xcodeproj/project.pbxproj View File

@ -25,7 +25,7 @@
35380AE8247C784E004A08A6 /* pEpUpdater.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pEpUpdater.h; sourceTree = "<group>"; };
35380AE9247C784E004A08A6 /* pEpUpdater.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = pEpUpdater.mm; sourceTree = "<group>"; };
35DC18D2244DA19100FB2002 /* foundation.pEp.adapter.macOS.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = foundation.pEp.adapter.macOS.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
35DC18D5244DA19100FB2002 /* pEpMacOSAdapterProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pEpMacOSAdapterProtocol.h; sourceTree = "<group>"; };
35DC18D5244DA19100FB2002 /* PEPMacOSAdapterProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPMacOSAdapterProtocol.h; sourceTree = "<group>"; };
35DC18D6244DA19100FB2002 /* pEpMacOSAdapter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pEpMacOSAdapter.h; sourceTree = "<group>"; };
35DC18D7244DA19100FB2002 /* pEpMacOSAdapter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = pEpMacOSAdapter.m; sourceTree = "<group>"; };
35DC18D9244DA19100FB2002 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@ -65,7 +65,7 @@
isa = PBXGroup;
children = (
35380AE6247BD13A004A08A6 /* README.md */,
35DC18D5244DA19100FB2002 /* pEpMacOSAdapterProtocol.h */,
35DC18D5244DA19100FB2002 /* PEPMacOSAdapterProtocol.h */,
35DC18D6244DA19100FB2002 /* pEpMacOSAdapter.h */,
35DC18D7244DA19100FB2002 /* pEpMacOSAdapter.m */,
35380AE8247C784E004A08A6 /* pEpUpdater.h */,


pEpMacOSAdapter/pEpMacOSAdapterProtocol.h → pEpMacOSAdapter/PEPMacOSAdapterProtocol.h View File


+ 1
- 1
pEpMacOSAdapter/main.m View File

@ -31,7 +31,7 @@ pEpUpdater* updater = nil;
// Configure the connection.
// First, set the interface that the exported object implements.
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(pEpMacOSAdapterProtocol)];
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(PEPMacOSAdapterProtocol)];
// Next, set the object that the connection exports. All messages sent on
// the connection to this service will be sent to the exported object to


+ 2
- 2
pEpMacOSAdapter/pEpMacOSAdapter.h View File

@ -8,10 +8,10 @@
//
#import <Foundation/Foundation.h>
#import "pEpMacOSAdapterProtocol.h"
#import "PEPMacOSAdapterProtocol.h"
/// This object implements the protocol which we have defined. It provides the actual behavior for the service. It is 'exported' by the service to make it available to the process hosting the service over an NSXPCConnection.
@interface pEpMacOSAdapter : NSObject <pEpMacOSAdapterProtocol>
@interface pEpMacOSAdapter : NSObject <PEPMacOSAdapterProtocol>
@property (retain) NSXPCConnection* clientConnection;


+ 2
- 2
pEpMacOSAdapter/pEpMacOSAdapter.m View File

@ -14,7 +14,7 @@ extern pEpUpdater* updater;
@implementation pEpMacOSAdapter
// begin pEpMacOSAdapterProtocol
// begin PEPMacOSAdapterProtocol
- (void)subscribeForUpdate:(NSXPCListenerEndpoint*)endpoint
{
@ -68,6 +68,6 @@ extern pEpUpdater* updater;
if (updater) [updater stopUpdates];
}
// end pEpMacOSAdapterProtocol
// end PEPMacOSAdapterProtocol
@end

+ 1
- 1
pEpMacOSAdapter/pEpUpdater.h View File

@ -8,7 +8,7 @@
//
#import <Foundation/Foundation.h>
#import "pEpMacOSAdapterProtocol.h"
#import "PEPMacOSAdapterProtocol.h"
/// object encapsulating the update client functionality of downloadclient
@interface pEpUpdater : NSObject


Loading…
Cancel
Save