| 1 | /* X11Application.h -- subclass of NSApplication to multiplex events |
| 2 | * |
| 3 | * Copyright (c) 2002-2012 Apple Inc. All rights reserved. |
| 4 | * |
| 5 | * Permission is hereby granted, free of charge, to any person |
| 6 | * obtaining a copy of this software and associated documentation files |
| 7 | * (the "Software"), to deal in the Software without restriction, |
| 8 | * including without limitation the rights to use, copy, modify, merge, |
| 9 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 10 | * and to permit persons to whom the Software is furnished to do so, |
| 11 | * subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be |
| 14 | * included in all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT |
| 20 | * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 23 | * DEALINGS IN THE SOFTWARE. |
| 24 | * |
| 25 | * Except as contained in this notice, the name(s) of the above |
| 26 | * copyright holders shall not be used in advertising or otherwise to |
| 27 | * promote the sale, use or other dealings in this Software without |
| 28 | * prior written authorization. |
| 29 | */ |
| 30 | |
| 31 | #ifndef X11APPLICATION_H |
| 32 | #define X11APPLICATION_H 1 |
| 33 | |
| 34 | #if __OBJC__ |
| 35 | |
| 36 | #import "X11Controller.h" |
| 37 | |
| 38 | @interface X11Application : NSApplication { |
| 39 | X11Controller *_controller; |
| 40 | |
| 41 | unsigned int _x_active : 1; |
| 42 | } |
| 43 | |
| 44 | - (void)set_controller:controller; |
| 45 | - (void)set_window_menu:(NSArray *)list; |
| 46 | |
| 47 | - (CFPropertyListRef)prefs_get_copy:(NSString *)key CF_RETURNS_RETAINED; |
| 48 | - (int)prefs_get_integer:(NSString *)key default:(int)def; |
| 49 | - (const char *)prefs_get_string:(NSString *)key default:(const char *)def; |
| 50 | - (float)prefs_get_float:(NSString *)key default:(float)def; |
| 51 | - (int)prefs_get_boolean:(NSString *)key default:(int)def; |
| 52 | - (NSURL *)prefs_copy_url:(NSString *)key default:(NSURL *)def |
| 53 | NS_RETURNS_RETAINED; |
| 54 | - (NSArray *)prefs_get_array:(NSString *)key; |
| 55 | - (void)prefs_set_integer:(NSString *)key value:(int)value; |
| 56 | - (void)prefs_set_float:(NSString *)key value:(float)value; |
| 57 | - (void)prefs_set_boolean:(NSString *)key value:(int)value; |
| 58 | - (void)prefs_set_array:(NSString *)key value:(NSArray *)value; |
| 59 | - (void)prefs_set_string:(NSString *)key value:(NSString *)value; |
| 60 | - (void)prefs_synchronize; |
| 61 | |
| 62 | - (X11Controller *)controller; |
| 63 | - (OSX_BOOL)x_active; |
| 64 | @end |
| 65 | |
| 66 | extern X11Application * X11App; |
| 67 | |
| 68 | #endif /* __OBJC__ */ |
| 69 | |
| 70 | void |
| 71 | X11ApplicationSetWindowMenu(int nitems, const char **items, |
| 72 | const char *shortcuts); |
| 73 | void |
| 74 | X11ApplicationSetWindowMenuCheck(int idx); |
| 75 | void |
| 76 | X11ApplicationSetFrontProcess(void); |
| 77 | void |
| 78 | X11ApplicationSetCanQuit(int state); |
| 79 | void |
| 80 | X11ApplicationServerReady(void); |
| 81 | void |
| 82 | X11ApplicationShowHideMenubar(int state); |
| 83 | void |
| 84 | X11ApplicationLaunchClient(const char *cmd); |
| 85 | |
| 86 | Bool |
| 87 | X11ApplicationCanEnterRandR(void); |
| 88 | |
| 89 | void |
| 90 | X11ApplicationFatalError(const char *f, va_list args) __printflike(1, 0); |
| 91 | |
| 92 | void |
| 93 | X11ApplicationMain(int argc, char **argv, char **envp); |
| 94 | |
| 95 | #define PREFS_APPSMENU "apps_menu" |
| 96 | #define PREFS_FAKEBUTTONS "enable_fake_buttons" |
| 97 | #define PREFS_KEYEQUIVS "enable_key_equivalents" |
| 98 | #define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys" |
| 99 | #define PREFS_FULLSCREEN_MENU "fullscreen_menu" |
| 100 | #define PREFS_SYNC_KEYMAP "sync_keymap" |
| 101 | #define PREFS_DEPTH "depth" |
| 102 | #define PREFS_NO_AUTH "no_auth" |
| 103 | #define PREFS_NO_TCP "nolisten_tcp" |
| 104 | #define PREFS_DONE_XINIT_CHECK "done_xinit_check" |
| 105 | #define PREFS_NO_QUIT_ALERT "no_quit_alert" |
| 106 | #define PREFS_NO_RANDR_ALERT "no_randr_alert" |
| 107 | #define PREFS_OPTION_SENDS_ALT "option_sends_alt" |
| 108 | #define PREFS_FAKE_BUTTON2 "fake_button2" |
| 109 | #define PREFS_FAKE_BUTTON3 "fake_button3" |
| 110 | #define PREFS_APPKIT_MODIFIERS "appkit_modifiers" |
| 111 | #define PREFS_WINDOW_ITEM_MODIFIERS "window_item_modifiers" |
| 112 | #define PREFS_ROOTLESS "rootless" |
| 113 | #define PREFS_RENDER_EXTENSION "enable_render_extension" |
| 114 | #define PREFS_TEST_EXTENSIONS "enable_test_extensions" |
| 115 | #define PREFS_XP_OPTIONS "xp_options" |
| 116 | #define PREFS_LOGIN_SHELL "login_shell" |
| 117 | #define PREFS_UPDATE_FEED "update_feed" |
| 118 | #define PREFS_CLICK_THROUGH "wm_click_through" |
| 119 | #define PREFS_FFM "wm_ffm" |
| 120 | #define PREFS_FOCUS_ON_NEW_WINDOW "wm_focus_on_new_window" |
| 121 | |
| 122 | #define PREFS_SCROLL_IN_DEV_DIRECTION "scroll_in_device_direction" |
| 123 | extern Bool XQuartzScrollInDeviceDirection; |
| 124 | |
| 125 | #define PREFS_SYNC_PB "sync_pasteboard" |
| 126 | #define PREFS_SYNC_PB_TO_CLIPBOARD "sync_pasteboard_to_clipboard" |
| 127 | #define PREFS_SYNC_PB_TO_PRIMARY "sync_pasteboard_to_primary" |
| 128 | #define PREFS_SYNC_CLIPBOARD_TO_PB "sync_clipboard_to_pasteboard" |
| 129 | #define PREFS_SYNC_PRIMARY_ON_SELECT "sync_primary_on_select" |
| 130 | |
| 131 | #endif /* X11APPLICATION_H */ |