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