|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. ! 26: * ! 27: * PCKeyboardDefs.h - PC Keyboard Defs for clients ! 28: * ! 29: * HISTORY ! 30: * 09 Sep 1992 Joe Pasqua ! 31: * Created. ! 32: */ ! 33: ! 34: // TO DO: ! 35: // ! 36: // NOTES: ! 37: // * This module defines types and protocols for use by PCKeyboard clients. ! 38: ! 39: #ifdef DRIVER_PRIVATE ! 40: ! 41: #import <kernserv/clock_timer.h> ! 42: ! 43: typedef struct _t_PCKeyboardEvent { ! 44: ns_time_t timeStamp; // When did this event happen ! 45: unsigned keyCode; // Which key was involved ! 46: BOOL goingDown; // YES -> it was pressed, NO -> it was released ! 47: } PCKeyboardEvent; ! 48: ! 49: ! 50: // ! 51: // The following protocol is implemented by PCKeyboard objects. Clients ! 52: // of the PCKeyboard can invoke the methods below to indicate their ! 53: // ownership of the PCKeyboard object. ! 54: // ! 55: @protocol PCKeyboardExported ! 56: ! 57: - (IOReturn)becomeOwner : client; ! 58: // Description: Register for event dispatch via device-specific protocol. ! 59: // (See the dispatchKeyboardEvent method) ! 60: // Returns IO_R_SUCCESS if successful, else IO_R_BUSY. The ! 61: // relinquishOwnershipRequest: method may be called on another ! 62: // client during the execution of this method. ! 63: ! 64: - (IOReturn)relinquishOwnership : client; ! 65: // Description: Relinquish ownership. Returns IO_R_BUSY if caller is not ! 66: // current owner. ! 67: ! 68: ! 69: - (IOReturn)desireOwnership : client; ! 70: // Description: Request notification (via canBecomeOwner:) when ! 71: // relinquishOwnership: is called. This allows one potential ! 72: // client to place itself "next in line" for ownership. The ! 73: // queue is only one deep. ! 74: ! 75: @end // PCKeyboardExported ! 76: ! 77: ! 78: // ! 79: // The following protocol is implemented by clients of the PCKeyboard ! 80: // object. A PCKeyboard instance will invoke these methods to indicate ! 81: // that an event has come in or that a change in ownership can happen. ! 82: // ! 83: @protocol PCKeyboardImported ! 84: ! 85: - (void)dispatchKeyboardEvent:(PCKeyboardEvent *)event; ! 86: // Description: Called when the keyboard object receives a new keyboard ! 87: // Event. The event structure should not be freed by the callee. ! 88: ! 89: ! 90: - (IOReturn)relinquishOwnershipRequest : device; ! 91: // Description: Called when another client wishes to assume ownership of ! 92: // calling kbd Device. This happens when a client attempts a ! 93: // becomeOwner: on a device which is owned by the callee of ! 94: // this method. ! 95: // Returns: ! 96: // IO_R_SUCCESS ==> It's OK to give ownership of the device to ! 97: // other client. In this case, callee no longer ! 98: // owns the device. ! 99: // IO_R_BUSY ==> Don't transfer ownership. ! 100: ! 101: ! 102: - (IOReturn)canBecomeOwner : device; ! 103: // Description: Method by which a client, who has registered "intent to own" ! 104: // via desireOwnership:client, is notified that the calling ! 105: // device is available. Client will typically call becomeOwner: ! 106: // during this call. ! 107: ! 108: @end // PCKeyboardImported ! 109: ! 110: #endif /* DRIVER_PRIVATE */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.