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 * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
9 *
10 * See the file "license.terms" for information on usage and redistribution of
11 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
12 *
13 *	The following terms apply to all files originating from Apple
14 *	Computer, Inc. ("Apple") and associated with the software
15 *	unless explicitly disclaimed in individual files.
16 *
17 *
18 *	Apple hereby grants permission to use, copy, modify,
19 *	distribute, and license this software and its documentation
20 *	for any purpose, provided that existing copyright notices are
21 *	retained in all copies and that this notice is included
22 *	verbatim in any distributions. No written agreement, license,
23 *	or royalty fee is required for any of the authorized
24 *	uses. Modifications to this software may be copyrighted by
25 *	their authors and need not follow the licensing terms
26 *	described here, provided that the new terms are clearly
27 *	indicated on the first page of each file where they apply.
28 *
29 *
30 *	IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
31 *	SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
32 *	INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
33 *	THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
34 *	EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
35 *	POSSIBILITY OF SUCH DAMAGE.  APPLE, THE AUTHORS AND
36 *	DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
37 *	BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
38 *	FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.	 THIS
39 *	SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
40 *	AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
41 *	MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
42 *
43 *	GOVERNMENT USE: If you are acquiring this software on behalf
44 *	of the U.S. government, the Government shall have only
45 *	"Restricted Rights" in the software and related documentation
46 *	as defined in the Federal Acquisition Regulations (FARs) in
47 *	Clause 52.227.19 (c) (2).  If you are acquiring the software
48 *	on behalf of the Department of Defense, the software shall be
49 *	classified as "Commercial Computer Software" and the
50 *	Government shall have only "Restricted Rights" as defined in
51 *	Clause 252.227-7013 (c) (1) of DFARs.  Notwithstanding the
52 *	foregoing, the authors grant the U.S. Government and others
53 *	acting in its behalf permission to use and distribute the
54 *	software in accordance with the terms specified in this
55 *	license.
56 *
57 * RCS: @(#) $Id: tkMacOSXEvent.h,v 1.3.2.8 2007/04/29 02:26:49 das Exp $
58 */
59
60#ifndef _TKMACEVENT
61#define _TKMACEVENT
62
63#ifndef _TKMACINT
64#include "tkMacOSXInt.h"
65#endif
66
67typedef struct {
68    int stopProcessing;
69    int err;
70    char errMsg[1024];
71} MacEventStatus;
72
73/*
74 * The event information in passed in the following structures
75 */
76typedef struct {
77    EventRef   eventRef;
78    UInt32     eClass;	/* Defines the class of event : see CarbonEvents.h */
79    UInt32     eKind;	/* Defines the kind of the event : see CarbonEvents.h */
80    Tcl_Interp *interp; /* Interp to handle events in */
81    EventHandlerCallRef callRef;
82} TkMacOSXEvent;
83
84MODULE_SCOPE void TkMacOSXFlushWindows(void);
85MODULE_SCOPE int TkMacOSXProcessEvent(TkMacOSXEvent *eventPtr,
86	MacEventStatus *statusPtr);
87MODULE_SCOPE int TkMacOSXProcessMouseEvent(TkMacOSXEvent *e,
88	MacEventStatus *statusPtr);
89MODULE_SCOPE int TkMacOSXProcessWindowEvent(TkMacOSXEvent *e,
90	MacEventStatus *statusPtr);
91MODULE_SCOPE int TkMacOSXProcessKeyboardEvent(TkMacOSXEvent *e,
92	MacEventStatus *statusPtr);
93MODULE_SCOPE int TkMacOSXProcessApplicationEvent(TkMacOSXEvent *e,
94	MacEventStatus *statusPtr);
95MODULE_SCOPE int TkMacOSXProcessAppearanceEvent(TkMacOSXEvent *e,
96	MacEventStatus *statusPtr);
97MODULE_SCOPE int TkMacOSXProcessMenuEvent(TkMacOSXEvent *e,
98	MacEventStatus *statusPtr);
99MODULE_SCOPE int TkMacOSXProcessCommandEvent(TkMacOSXEvent *e,
100	MacEventStatus *statusPtr);
101MODULE_SCOPE int TkMacOSXKeycodeToUnicode(
102	UniChar * uniChars, int maxChars,
103	EventKind eKind,
104	UInt32 keycode, UInt32 modifiers,
105	UInt32 * deadKeyStatePtr);
106
107#endif
108