xref: /OK3568_Linux_fs/external/xserver/hw/xquartz/X11Application.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* X11Application.h -- subclass of NSApplication to multiplex events
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 X11APPLICATION_H
32*4882a593Smuzhiyun #define X11APPLICATION_H 1
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun #include <X11/Xdefs.h>
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #if __OBJC__
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #import "X11Controller.h"
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun @interface X11Application : NSApplication
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun @property (nonatomic, readwrite, strong) X11Controller *controller;
43*4882a593Smuzhiyun @property (nonatomic, readonly, assign) OSX_BOOL x_active;
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun - (CFPropertyListRef)prefs_get_copy:(NSString *)key CF_RETURNS_RETAINED;
46*4882a593Smuzhiyun - (int)prefs_get_integer:(NSString *)key default:(int)def;
47*4882a593Smuzhiyun - (const char *)prefs_get_string:(NSString *)key default:(const char *)def;
48*4882a593Smuzhiyun - (float)prefs_get_float:(NSString *)key default:(float)def;
49*4882a593Smuzhiyun - (int)prefs_get_boolean:(NSString *)key default:(int)def;
50*4882a593Smuzhiyun - (NSURL *)prefs_copy_url:(NSString *)key default:(NSURL *)def
51*4882a593Smuzhiyun    NS_RETURNS_RETAINED;
52*4882a593Smuzhiyun - (NSArray *)prefs_get_array:(NSString *)key;
53*4882a593Smuzhiyun - (void)prefs_set_integer:(NSString *)key value:(int)value;
54*4882a593Smuzhiyun - (void)prefs_set_float:(NSString *)key value:(float)value;
55*4882a593Smuzhiyun - (void)prefs_set_boolean:(NSString *)key value:(int)value;
56*4882a593Smuzhiyun - (void)prefs_set_array:(NSString *)key value:(NSArray *)value;
57*4882a593Smuzhiyun - (void)prefs_set_string:(NSString *)key value:(NSString *)value;
58*4882a593Smuzhiyun - (void)prefs_synchronize;
59*4882a593Smuzhiyun @end
60*4882a593Smuzhiyun 
61*4882a593Smuzhiyun extern X11Application * X11App;
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun #endif /* __OBJC__ */
64*4882a593Smuzhiyun 
65*4882a593Smuzhiyun void
66*4882a593Smuzhiyun X11ApplicationSetWindowMenu(int nitems, const char **items,
67*4882a593Smuzhiyun                             const char *shortcuts);
68*4882a593Smuzhiyun void
69*4882a593Smuzhiyun X11ApplicationSetWindowMenuCheck(int idx);
70*4882a593Smuzhiyun void
71*4882a593Smuzhiyun X11ApplicationSetFrontProcess(void);
72*4882a593Smuzhiyun void
73*4882a593Smuzhiyun X11ApplicationSetCanQuit(int state);
74*4882a593Smuzhiyun void
75*4882a593Smuzhiyun X11ApplicationServerReady(void);
76*4882a593Smuzhiyun void
77*4882a593Smuzhiyun X11ApplicationShowHideMenubar(int state);
78*4882a593Smuzhiyun void
79*4882a593Smuzhiyun X11ApplicationLaunchClient(const char *cmd);
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun Bool
82*4882a593Smuzhiyun X11ApplicationCanEnterRandR(void);
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun void
85*4882a593Smuzhiyun X11ApplicationMain(int argc, char **argv, char **envp);
86*4882a593Smuzhiyun 
87*4882a593Smuzhiyun #define PREFS_APPSMENU                "apps_menu"
88*4882a593Smuzhiyun #define PREFS_FAKEBUTTONS             "enable_fake_buttons"
89*4882a593Smuzhiyun #define PREFS_KEYEQUIVS               "enable_key_equivalents"
90*4882a593Smuzhiyun #define PREFS_FULLSCREEN_HOTKEYS      "fullscreen_hotkeys"
91*4882a593Smuzhiyun #define PREFS_FULLSCREEN_MENU         "fullscreen_menu"
92*4882a593Smuzhiyun #define PREFS_SYNC_KEYMAP             "sync_keymap"
93*4882a593Smuzhiyun #define PREFS_DEPTH                   "depth"
94*4882a593Smuzhiyun #define PREFS_NO_AUTH                 "no_auth"
95*4882a593Smuzhiyun #define PREFS_NO_TCP                  "nolisten_tcp"
96*4882a593Smuzhiyun #define PREFS_DONE_XINIT_CHECK        "done_xinit_check"
97*4882a593Smuzhiyun #define PREFS_NO_QUIT_ALERT           "no_quit_alert"
98*4882a593Smuzhiyun #define PREFS_NO_RANDR_ALERT          "no_randr_alert"
99*4882a593Smuzhiyun #define PREFS_OPTION_SENDS_ALT        "option_sends_alt"
100*4882a593Smuzhiyun #define PREFS_FAKE_BUTTON2            "fake_button2"
101*4882a593Smuzhiyun #define PREFS_FAKE_BUTTON3            "fake_button3"
102*4882a593Smuzhiyun #define PREFS_APPKIT_MODIFIERS        "appkit_modifiers"
103*4882a593Smuzhiyun #define PREFS_WINDOW_ITEM_MODIFIERS   "window_item_modifiers"
104*4882a593Smuzhiyun #define PREFS_ROOTLESS                "rootless"
105*4882a593Smuzhiyun #define PREFS_RENDER_EXTENSION        "enable_render_extension"
106*4882a593Smuzhiyun #define PREFS_TEST_EXTENSIONS         "enable_test_extensions"
107*4882a593Smuzhiyun #define PREFS_XP_OPTIONS              "xp_options"
108*4882a593Smuzhiyun #define PREFS_LOGIN_SHELL             "login_shell"
109*4882a593Smuzhiyun #define PREFS_UPDATE_FEED             "update_feed"
110*4882a593Smuzhiyun #define PREFS_CLICK_THROUGH           "wm_click_through"
111*4882a593Smuzhiyun #define PREFS_FFM                     "wm_ffm"
112*4882a593Smuzhiyun #define PREFS_FOCUS_ON_NEW_WINDOW     "wm_focus_on_new_window"
113*4882a593Smuzhiyun 
114*4882a593Smuzhiyun #define PREFS_SCROLL_IN_DEV_DIRECTION "scroll_in_device_direction"
115*4882a593Smuzhiyun extern Bool XQuartzScrollInDeviceDirection;
116*4882a593Smuzhiyun 
117*4882a593Smuzhiyun #define PREFS_SYNC_PB                "sync_pasteboard"
118*4882a593Smuzhiyun #define PREFS_SYNC_PB_TO_CLIPBOARD   "sync_pasteboard_to_clipboard"
119*4882a593Smuzhiyun #define PREFS_SYNC_PB_TO_PRIMARY     "sync_pasteboard_to_primary"
120*4882a593Smuzhiyun #define PREFS_SYNC_CLIPBOARD_TO_PB   "sync_clipboard_to_pasteboard"
121*4882a593Smuzhiyun #define PREFS_SYNC_PRIMARY_ON_SELECT "sync_primary_on_select"
122*4882a593Smuzhiyun 
123*4882a593Smuzhiyun #endif /* X11APPLICATION_H */
124