1/* X11Controller.h -- connect the IB ui
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 X11CONTROLLER_H
32#define X11CONTROLLER_H 1
33
34#ifdef HAVE_DIX_CONFIG_H
35#include <dix-config.h>
36#endif
37
38#if __OBJC__
39
40#include "sanitizedCocoa.h"
41#include "xpr/x-list.h"
42
43#ifdef XQUARTZ_SPARKLE
44#define BOOL OSX_BOOL
45#include <Sparkle/SUUpdater.h>
46#undef BOOL
47#endif
48
49@interface X11Controller : NSObject <NSTableViewDataSource>
50@property (nonatomic, readwrite, strong) IBOutlet NSPanel *prefs_panel;
51
52@property (nonatomic, readwrite, strong) IBOutlet NSButton *fake_buttons;
53@property (nonatomic, readwrite, strong) IBOutlet NSButton *enable_fullscreen;
54@property (nonatomic, readwrite, strong) IBOutlet NSButton *enable_fullscreen_menu;
55@property (nonatomic, readwrite, strong) IBOutlet NSTextField *enable_fullscreen_menu_text;
56@property (nonatomic, readwrite, strong) IBOutlet NSButton *enable_keyequivs;
57@property (nonatomic, readwrite, strong) IBOutlet NSButton *sync_keymap;
58@property (nonatomic, readwrite, strong) IBOutlet NSButton *option_sends_alt;
59@property (nonatomic, readwrite, strong) IBOutlet NSButton *scroll_in_device_direction;
60@property (nonatomic, readwrite, strong) IBOutlet NSButton *click_through;
61@property (nonatomic, readwrite, strong) IBOutlet NSButton *focus_follows_mouse;
62@property (nonatomic, readwrite, strong) IBOutlet NSButton *focus_on_new_window;
63@property (nonatomic, readwrite, strong) IBOutlet NSButton *enable_auth;
64@property (nonatomic, readwrite, strong) IBOutlet NSButton *enable_tcp;
65@property (nonatomic, readwrite, strong) IBOutlet NSButton *sync_pasteboard;
66@property (nonatomic, readwrite, strong) IBOutlet NSButton *sync_pasteboard_to_clipboard;
67@property (nonatomic, readwrite, strong) IBOutlet NSButton *sync_pasteboard_to_primary;
68@property (nonatomic, readwrite, strong) IBOutlet NSButton *sync_clipboard_to_pasteboard;
69@property (nonatomic, readwrite, strong) IBOutlet NSButton *sync_primary_immediately;
70@property (nonatomic, readwrite, strong) IBOutlet NSTextField *sync_text1;
71@property (nonatomic, readwrite, strong) IBOutlet NSTextField *sync_text2;
72@property (nonatomic, readwrite, strong) IBOutlet NSPopUpButton *depth;
73
74@property (nonatomic, readwrite, strong) IBOutlet NSMenuItem *x11_about_item;
75@property (nonatomic, readwrite, strong) IBOutlet NSMenuItem *dock_window_separator;
76@property (nonatomic, readwrite, strong) IBOutlet NSMenuItem *apps_separator;
77@property (nonatomic, readwrite, strong) IBOutlet NSMenuItem *toggle_fullscreen_item;
78
79@property (nonatomic, readwrite, strong) IBOutlet NSMenuItem *copy_menu_item;
80@property (nonatomic, readwrite, strong) IBOutlet NSMenu *dock_apps_menu;
81@property (nonatomic, readwrite, strong) IBOutlet NSTableView *apps_table;
82
83@property (nonatomic, readwrite, strong) IBOutlet NSMenu *dock_menu;
84
85@property (nonatomic, readwrite, assign) OSX_BOOL can_quit;
86
87- (void)set_window_menu:(NSArray *)list;
88- (void)set_window_menu_check:(NSNumber *)n;
89- (void)set_apps_menu:(NSArray *)list;
90#ifdef XQUARTZ_SPARKLE
91- (void)setup_sparkle;
92- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)
93   update;
94#endif
95- (void)server_ready;
96- (OSX_BOOL)application:(NSApplication *)app openFile:(NSString *)filename;
97
98- (IBAction)apps_table_show:(id)sender;
99- (IBAction)apps_table_done:(id)sender;
100- (IBAction)apps_table_new:(id)sender;
101- (IBAction)apps_table_duplicate:(id)sender;
102- (IBAction)apps_table_delete:(id)sender;
103- (IBAction)bring_to_front:(id)sender;
104- (IBAction)close_window:(id)sender;
105- (IBAction)minimize_window:(id)sender;
106- (IBAction)zoom_window:(id)sender;
107- (IBAction)next_window:(id)sender;
108- (IBAction)previous_window:(id)sender;
109- (IBAction)enable_fullscreen_changed:(id)sender;
110- (IBAction)toggle_fullscreen:(id)sender;
111- (IBAction)prefs_changed:(id)sender;
112- (IBAction)prefs_show:(id)sender;
113- (IBAction)quit:(id)sender;
114- (IBAction)x11_help:(id)sender;
115
116@end
117
118#endif /* __OBJC__ */
119
120void
121X11ControllerMain(int argc, char **argv, char **envp);
122
123#endif /* X11CONTROLLER_H */
124