X11Application.h revision c8548ba8
14642e01fSmrg/* X11Application.h -- subclass of NSApplication to multiplex events 235c4bbdfSmrg * 335c4bbdfSmrg * Copyright (c) 2002-2012 Apple Inc. All rights reserved. 435c4bbdfSmrg * 535c4bbdfSmrg * Permission is hereby granted, free of charge, to any person 635c4bbdfSmrg * obtaining a copy of this software and associated documentation files 735c4bbdfSmrg * (the "Software"), to deal in the Software without restriction, 835c4bbdfSmrg * including without limitation the rights to use, copy, modify, merge, 935c4bbdfSmrg * publish, distribute, sublicense, and/or sell copies of the Software, 1035c4bbdfSmrg * and to permit persons to whom the Software is furnished to do so, 1135c4bbdfSmrg * subject to the following conditions: 1235c4bbdfSmrg * 1335c4bbdfSmrg * The above copyright notice and this permission notice shall be 1435c4bbdfSmrg * included in all copies or substantial portions of the Software. 1535c4bbdfSmrg * 1635c4bbdfSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 1735c4bbdfSmrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1835c4bbdfSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 1935c4bbdfSmrg * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT 2035c4bbdfSmrg * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 2135c4bbdfSmrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 2235c4bbdfSmrg * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 2335c4bbdfSmrg * DEALINGS IN THE SOFTWARE. 2435c4bbdfSmrg * 2535c4bbdfSmrg * Except as contained in this notice, the name(s) of the above 2635c4bbdfSmrg * copyright holders shall not be used in advertising or otherwise to 2735c4bbdfSmrg * promote the sale, use or other dealings in this Software without 2835c4bbdfSmrg * prior written authorization. 2935c4bbdfSmrg */ 304642e01fSmrg 314642e01fSmrg#ifndef X11APPLICATION_H 324642e01fSmrg#define X11APPLICATION_H 1 334642e01fSmrg 34c8548ba8Smrg#include <X11/Xdefs.h> 35c8548ba8Smrg 364642e01fSmrg#if __OBJC__ 374642e01fSmrg 384642e01fSmrg#import "X11Controller.h" 394642e01fSmrg 40c8548ba8Smrg@interface X11Application : NSApplication 414642e01fSmrg 42c8548ba8Smrg@property (nonatomic, readwrite, strong) X11Controller *controller; 43c8548ba8Smrg@property (nonatomic, readonly, assign) OSX_BOOL x_active; 4435c4bbdfSmrg 4535c4bbdfSmrg- (CFPropertyListRef)prefs_get_copy:(NSString *)key CF_RETURNS_RETAINED; 4635c4bbdfSmrg- (int)prefs_get_integer:(NSString *)key default:(int)def; 4735c4bbdfSmrg- (const char *)prefs_get_string:(NSString *)key default:(const char *)def; 4835c4bbdfSmrg- (float)prefs_get_float:(NSString *)key default:(float)def; 4935c4bbdfSmrg- (int)prefs_get_boolean:(NSString *)key default:(int)def; 5035c4bbdfSmrg- (NSURL *)prefs_copy_url:(NSString *)key default:(NSURL *)def 5135c4bbdfSmrg NS_RETURNS_RETAINED; 5235c4bbdfSmrg- (NSArray *)prefs_get_array:(NSString *)key; 5335c4bbdfSmrg- (void)prefs_set_integer:(NSString *)key value:(int)value; 5435c4bbdfSmrg- (void)prefs_set_float:(NSString *)key value:(float)value; 5535c4bbdfSmrg- (void)prefs_set_boolean:(NSString *)key value:(int)value; 5635c4bbdfSmrg- (void)prefs_set_array:(NSString *)key value:(NSArray *)value; 5735c4bbdfSmrg- (void)prefs_set_string:(NSString *)key value:(NSString *)value; 5835c4bbdfSmrg- (void)prefs_synchronize; 594642e01fSmrg@end 604642e01fSmrg 6135c4bbdfSmrgextern X11Application * X11App; 624642e01fSmrg 634642e01fSmrg#endif /* __OBJC__ */ 644642e01fSmrg 6535c4bbdfSmrgvoid 6635c4bbdfSmrgX11ApplicationSetWindowMenu(int nitems, const char **items, 6735c4bbdfSmrg const char *shortcuts); 6835c4bbdfSmrgvoid 6935c4bbdfSmrgX11ApplicationSetWindowMenuCheck(int idx); 7035c4bbdfSmrgvoid 7135c4bbdfSmrgX11ApplicationSetFrontProcess(void); 7235c4bbdfSmrgvoid 7335c4bbdfSmrgX11ApplicationSetCanQuit(int state); 7435c4bbdfSmrgvoid 7535c4bbdfSmrgX11ApplicationServerReady(void); 7635c4bbdfSmrgvoid 7735c4bbdfSmrgX11ApplicationShowHideMenubar(int state); 7835c4bbdfSmrgvoid 7935c4bbdfSmrgX11ApplicationLaunchClient(const char *cmd); 8035c4bbdfSmrg 8135c4bbdfSmrgBool 8235c4bbdfSmrgX11ApplicationCanEnterRandR(void); 8335c4bbdfSmrg 8435c4bbdfSmrgvoid 8535c4bbdfSmrgX11ApplicationMain(int argc, char **argv, char **envp); 8635c4bbdfSmrg 8735c4bbdfSmrg#define PREFS_APPSMENU "apps_menu" 8835c4bbdfSmrg#define PREFS_FAKEBUTTONS "enable_fake_buttons" 8935c4bbdfSmrg#define PREFS_KEYEQUIVS "enable_key_equivalents" 9035c4bbdfSmrg#define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys" 9135c4bbdfSmrg#define PREFS_FULLSCREEN_MENU "fullscreen_menu" 9235c4bbdfSmrg#define PREFS_SYNC_KEYMAP "sync_keymap" 9335c4bbdfSmrg#define PREFS_DEPTH "depth" 9435c4bbdfSmrg#define PREFS_NO_AUTH "no_auth" 9535c4bbdfSmrg#define PREFS_NO_TCP "nolisten_tcp" 9635c4bbdfSmrg#define PREFS_DONE_XINIT_CHECK "done_xinit_check" 9735c4bbdfSmrg#define PREFS_NO_QUIT_ALERT "no_quit_alert" 9835c4bbdfSmrg#define PREFS_NO_RANDR_ALERT "no_randr_alert" 9935c4bbdfSmrg#define PREFS_OPTION_SENDS_ALT "option_sends_alt" 10035c4bbdfSmrg#define PREFS_FAKE_BUTTON2 "fake_button2" 10135c4bbdfSmrg#define PREFS_FAKE_BUTTON3 "fake_button3" 10235c4bbdfSmrg#define PREFS_APPKIT_MODIFIERS "appkit_modifiers" 10335c4bbdfSmrg#define PREFS_WINDOW_ITEM_MODIFIERS "window_item_modifiers" 10435c4bbdfSmrg#define PREFS_ROOTLESS "rootless" 10535c4bbdfSmrg#define PREFS_RENDER_EXTENSION "enable_render_extension" 10635c4bbdfSmrg#define PREFS_TEST_EXTENSIONS "enable_test_extensions" 10735c4bbdfSmrg#define PREFS_XP_OPTIONS "xp_options" 10835c4bbdfSmrg#define PREFS_LOGIN_SHELL "login_shell" 10935c4bbdfSmrg#define PREFS_UPDATE_FEED "update_feed" 11035c4bbdfSmrg#define PREFS_CLICK_THROUGH "wm_click_through" 11135c4bbdfSmrg#define PREFS_FFM "wm_ffm" 11235c4bbdfSmrg#define PREFS_FOCUS_ON_NEW_WINDOW "wm_focus_on_new_window" 1134642e01fSmrg 114475c125cSmrg#define PREFS_SCROLL_IN_DEV_DIRECTION "scroll_in_device_direction" 115475c125cSmrgextern Bool XQuartzScrollInDeviceDirection; 116475c125cSmrg 1174642e01fSmrg#define PREFS_SYNC_PB "sync_pasteboard" 1184642e01fSmrg#define PREFS_SYNC_PB_TO_CLIPBOARD "sync_pasteboard_to_clipboard" 1194642e01fSmrg#define PREFS_SYNC_PB_TO_PRIMARY "sync_pasteboard_to_primary" 1204642e01fSmrg#define PREFS_SYNC_CLIPBOARD_TO_PB "sync_clipboard_to_pasteboard" 1214642e01fSmrg#define PREFS_SYNC_PRIMARY_ON_SELECT "sync_primary_on_select" 1224642e01fSmrg 1234642e01fSmrg#endif /* X11APPLICATION_H */ 124