1706f2543Smrg/* pbproxy.h
2706f2543Smrg   Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved.
3706f2543Smrg
4706f2543Smrg   Permission is hereby granted, free of charge, to any person
5706f2543Smrg   obtaining a copy of this software and associated documentation files
6706f2543Smrg   (the "Software"), to deal in the Software without restriction,
7706f2543Smrg   including without limitation the rights to use, copy, modify, merge,
8706f2543Smrg   publish, distribute, sublicense, and/or sell copies of the Software,
9706f2543Smrg   and to permit persons to whom the Software is furnished to do so,
10706f2543Smrg   subject to the following conditions:
11706f2543Smrg
12706f2543Smrg   The above copyright notice and this permission notice shall be
13706f2543Smrg   included in all copies or substantial portions of the Software.
14706f2543Smrg
15706f2543Smrg   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16706f2543Smrg   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17706f2543Smrg   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18706f2543Smrg   NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
19706f2543Smrg   HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20706f2543Smrg   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21706f2543Smrg   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22706f2543Smrg   DEALINGS IN THE SOFTWARE.
23706f2543Smrg
24706f2543Smrg   Except as contained in this notice, the name(s) of the above
25706f2543Smrg   copyright holders shall not be used in advertising or otherwise to
26706f2543Smrg   promote the sale, use or other dealings in this Software without
27706f2543Smrg   prior written authorization.
28706f2543Smrg*/
29706f2543Smrg
30706f2543Smrg#ifndef PBPROXY_H
31706f2543Smrg#define PBPROXY_H 1
32706f2543Smrg
33706f2543Smrg#import  <Foundation/Foundation.h>
34706f2543Smrg
35706f2543Smrg#include <AvailabilityMacros.h>
36706f2543Smrg#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
37706f2543Smrg#if __LP64__ || NS_BUILD_32_LIKE_64
38706f2543Smrgtypedef long NSInteger;
39706f2543Smrgtypedef unsigned long NSUInteger;
40706f2543Smrg#else
41706f2543Smrgtypedef int NSInteger;
42706f2543Smrgtypedef unsigned int NSUInteger;
43706f2543Smrg#endif
44706f2543Smrg#endif
45706f2543Smrg
46706f2543Smrg#define  Cursor X_Cursor
47706f2543Smrg#undef _SHAPE_H_
48706f2543Smrg#include <X11/Xlib.h>
49706f2543Smrg#include <X11/extensions/shape.h>
50706f2543Smrg#undef   Cursor
51706f2543Smrg
52706f2543Smrg#ifdef STANDALONE_XPBPROXY
53706f2543Smrg/* Just used for the standalone to respond to SIGHUP to reload prefs */
54706f2543Smrgextern BOOL xpbproxy_prefs_reload;
55706f2543Smrg
56706f2543Smrg/* Setting this to YES (for the standalone app) causes us to ignore the
57706f2543Smrg * 'sync_pasteboard' defaults preference since we assume it to be on... this is
58706f2543Smrg * mainly useful for debugging/developing xpbproxy with XQuartz still running.
59706f2543Smrg * Just disable the one in the server with X11's preference pane, then run
60706f2543Smrg * the standalone app.
61706f2543Smrg */
62706f2543Smrgextern BOOL xpbproxy_is_standalone;
63706f2543Smrg#endif
64706f2543Smrg
65706f2543Smrg/* from main.m */
66706f2543Smrgextern void xpbproxy_set_is_active (BOOL state);
67706f2543Smrgextern BOOL xpbproxy_get_is_active (void);
68706f2543Smrgextern id xpbproxy_selection_object (void);
69706f2543Smrgextern Time xpbproxy_current_timestamp (void);
70706f2543Smrgextern int xpbproxy_run (void);
71706f2543Smrg
72706f2543Smrgextern Display *xpbproxy_dpy;
73706f2543Smrgextern int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base;
74706f2543Smrgextern int xpbproxy_xfixes_event_base, xpbproxy_xfixes_error_base;
75706f2543Smrgextern BOOL xpbproxy_have_xfixes;
76706f2543Smrg
77706f2543Smrg/* from x-input.m */
78706f2543Smrgextern BOOL xpbproxy_input_register (void);
79706f2543Smrg
80706f2543Smrg#ifdef DEBUG
81706f2543Smrg/* BEWARE: this can cause a string memory leak, according to the leaks program. */
82706f2543Smrg# define DB(msg, args...) debug_printf("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args)
83706f2543Smrg#else
84706f2543Smrg# define DB(msg, args...) do {} while (0)
85706f2543Smrg#endif
86706f2543Smrg
87706f2543Smrg#define TRACE() DB("TRACE\n")
88706f2543Smrgextern void debug_printf (const char *fmt, ...);
89706f2543Smrg
90706f2543Smrg#endif /* PBPROXY_H */
91