OSDN Git Service

Initial revision
[pf3gnuchains/sourceware.git] / tk / macosx / tkMacOSXEvent.h
1 /*
2  * tkMacOSXEvent.h --
3  *
4  *      Declarations of Macintosh specific functions for implementing the
5  *      Mac OS X Notifier.
6  *
7  *      Copyright 2001, Apple Computer, Inc.
8  *
9  *      The following terms apply to all files originating from Apple
10  *      Computer, Inc. ("Apple") and associated with the software
11  *      unless explicitly disclaimed in individual files.
12  *
13  *
14  *      Apple hereby grants permission to use, copy, modify,
15  *      distribute, and license this software and its documentation
16  *      for any purpose, provided that existing copyright notices are
17  *      retained in all copies and that this notice is included
18  *      verbatim in any distributions. No written agreement, license,
19  *      or royalty fee is required for any of the authorized
20  *      uses. Modifications to this software may be copyrighted by
21  *      their authors and need not follow the licensing terms
22  *      described here, provided that the new terms are clearly
23  *      indicated on the first page of each file where they apply.
24  *
25  *
26  *      IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
27  *      SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
28  *      INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
29  *      THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
30  *      EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
31  *      POSSIBILITY OF SUCH DAMAGE.  APPLE, THE AUTHORS AND
32  *      DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
33  *      BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
34  *      FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS
35  *      SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
36  *      AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
37  *      MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
38  *
39  *      GOVERNMENT USE: If you are acquiring this software on behalf
40  *      of the U.S. government, the Government shall have only
41  *      "Restricted Rights" in the software and related documentation
42  *      as defined in the Federal Acquisition Regulations (FARs) in
43  *      Clause 52.227.19 (c) (2).  If you are acquiring the software
44  *      on behalf of the Department of Defense, the software shall be
45  *      classified as "Commercial Computer Software" and the
46  *      Government shall have only "Restricted Rights" as defined in
47  *      Clause 252.227-7013 (c) (1) of DFARs.  Notwithstanding the
48  *      foregoing, the authors grant the U.S. Government and others
49  *      acting in its behalf permission to use and distribute the
50  *      software in accordance with the terms specified in this
51  *      license.
52  */
53
54 #ifndef _TKMACEVENT
55 #define _TKMACEVENT
56
57 #include <Carbon/Carbon.h>
58 #include <tcl.h>
59
60 enum {
61  kEventClassWish = 'WiSH'
62 };
63
64 typedef struct {
65     int handledByTk;
66     int err;
67     char errMsg[1024];
68 } MacEventStatus;
69
70 /*
71  * The event information in passed in the following structures
72  */
73 typedef struct {
74     EventRef   eventRef;
75     UInt32     eClass;  /* Defines the class of event : see CarbonEvents.h */
76     UInt32     eKind;   /* Defines the kind of the event : see CarbonEvents.h */
77 } TkMacOSXEvent;
78
79 int TkMacOSXCountAndProcessMacEvents _ANSI_ARGS_(());
80 void tkMacOSXFlushWindows _ANSI_ARGS_(()); 
81 int TkMacOSXProcessMouseEvent(TkMacOSXEvent * e, MacEventStatus * statusPtr);
82 int TkMacOSXProcessWindowEvent(TkMacOSXEvent * e, MacEventStatus * statusPtr);
83 int TkMacOSXProcessKeyboardEvent(TkMacOSXEvent * e, MacEventStatus * statusPtr);
84 int TkMacOSXProcessApplicationEvent(TkMacOSXEvent * e, MacEventStatus * statusPtr);
85
86 #endif