pbproxy.h revision 4642e01f
1/* pbproxy.h 2 Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved. 3 4 Permission is hereby granted, free of charge, to any person 5 obtaining a copy of this software and associated documentation files 6 (the "Software"), to deal in the Software without restriction, 7 including without limitation the rights to use, copy, modify, merge, 8 publish, distribute, sublicense, and/or sell copies of the Software, 9 and to permit persons to whom the Software is furnished to do so, 10 subject to the following conditions: 11 12 The above copyright notice and this permission notice shall be 13 included in all copies or substantial portions of the Software. 14 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT 19 HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 DEALINGS IN THE SOFTWARE. 23 24 Except as contained in this notice, the name(s) of the above 25 copyright holders shall not be used in advertising or otherwise to 26 promote the sale, use or other dealings in this Software without 27 prior written authorization. 28*/ 29 30#ifndef PBPROXY_H 31#define PBPROXY_H 1 32 33#import <Foundation/Foundation.h> 34 35#include <AvailabilityMacros.h> 36#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 37#if __LP64__ || NS_BUILD_32_LIKE_64 38typedef long NSInteger; 39typedef unsigned long NSUInteger; 40#else 41typedef int NSInteger; 42typedef unsigned int NSUInteger; 43#endif 44#endif 45 46#define Cursor X_Cursor 47#undef _SHAPE_H_ 48#include <X11/Xlib.h> 49#include <X11/extensions/shape.h> 50#undef Cursor 51 52#ifdef STANDALONE_XPBPROXY 53/* Just used for the standalone to respond to SIGHUP to reload prefs */ 54extern BOOL xpbproxy_prefs_reload; 55 56/* Setting this to YES (for the standalone app) causes us to ignore the 57 * 'sync_pasteboard' defaults preference since we assume it to be on... this is 58 * mainly useful for debugging/developing xpbproxy with XQuartz still running. 59 * Just disable the one in the server with X11's preference pane, then run 60 * the standalone app. 61 */ 62extern BOOL xpbproxy_is_standalone; 63#endif 64 65/* from main.m */ 66extern void xpbproxy_set_is_active (BOOL state); 67extern BOOL xpbproxy_get_is_active (void); 68extern id xpbproxy_selection_object (void); 69extern Time xpbproxy_current_timestamp (void); 70extern BOOL xpbproxy_init (void); 71 72extern Display *xpbproxy_dpy; 73extern int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base; 74extern int xpbproxy_xfixes_event_base, xpbproxy_xfixes_error_base; 75extern BOOL xpbproxy_have_xfixes; 76 77/* from x-input.m */ 78extern BOOL xpbproxy_input_register (void); 79extern void xpbproxy_input_loop(); 80 81#ifdef DEBUG 82/* BEWARE: this can cause a string memory leak, according to the leaks program. */ 83# define DB(msg, args...) debug_printf("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args) 84#else 85# define DB(msg, args...) do {} while (0) 86#endif 87 88#define TRACE() DB("TRACE\n") 89extern void debug_printf (const char *fmt, ...); 90 91#endif /* PBPROXY_H */ 92