1/* X11Controller.h -- connect the IB ui
2
3   Copyright (c) 2002 Apple Computer, 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#ifndef X11CONTROLLER_H
31#define X11CONTROLLER_H 1
32
33#ifdef HAVE_DIX_CONFIG_H
34#include <dix-config.h>
35#endif
36
37#if __OBJC__
38
39#include "sanitizedCocoa.h"
40#include "xpr/x-list.h"
41
42#ifdef XQUARTZ_SPARKLE
43#define BOOL OSX_BOOL
44#include <Sparkle/SUUpdater.h>
45#undef BOOL
46#endif
47
48#ifndef NSINTEGER_DEFINED
49#if __LP64__ || NS_BUILD_32_LIKE_64
50typedef long NSInteger;
51typedef unsigned long NSUInteger;
52#else
53typedef int NSInteger;
54typedef unsigned int NSUInteger;
55#endif
56#endif
57
58@interface X11Controller : NSObject
59#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
60<NSTableViewDataSource>
61#endif
62{
63    IBOutlet NSPanel *prefs_panel;
64
65    IBOutlet NSButton *fake_buttons;
66    IBOutlet NSButton *enable_fullscreen;
67    IBOutlet NSButton *enable_fullscreen_menu;
68    IBOutlet NSTextField *enable_fullscreen_menu_text;
69    IBOutlet NSButton *enable_keyequivs;
70    IBOutlet NSButton *sync_keymap;
71    IBOutlet NSButton *option_sends_alt;
72    IBOutlet NSButton *scroll_in_device_direction;
73    IBOutlet NSButton *click_through;
74    IBOutlet NSButton *focus_follows_mouse;
75    IBOutlet NSButton *focus_on_new_window;
76    IBOutlet NSButton *enable_auth;
77    IBOutlet NSButton *enable_tcp;
78    IBOutlet NSButton *sync_pasteboard;
79    IBOutlet NSButton *sync_pasteboard_to_clipboard;
80    IBOutlet NSButton *sync_pasteboard_to_primary;
81    IBOutlet NSButton *sync_clipboard_to_pasteboard;
82    IBOutlet NSButton *sync_primary_immediately;
83    IBOutlet NSTextField *sync_text1;
84    IBOutlet NSTextField *sync_text2;
85    IBOutlet NSPopUpButton *depth;
86
87    IBOutlet NSMenuItem *window_separator;
88    // window_separator is DEPRECATED due to this radar:
89    // <rdar://problem/7088335> NSApplication releases the separator in the Windows menu even though it's an IBOutlet
90    // It is kept around for localization compatability and is subject to removal "eventually"
91    // If it is !NULL (meaning it is in the nib), it is removed from the menu and released
92
93    IBOutlet NSMenuItem *x11_about_item;
94    IBOutlet NSMenuItem *dock_window_separator;
95    IBOutlet NSMenuItem *apps_separator;
96    IBOutlet NSMenuItem *toggle_fullscreen_item;
97#ifdef XQUARTZ_SPARKLE
98    NSMenuItem *check_for_updates_item; // Programatically enabled
99#endif
100    IBOutlet NSMenuItem *copy_menu_item;
101    IBOutlet NSMenu *dock_apps_menu;
102    IBOutlet NSTableView *apps_table;
103
104    NSArray *apps;
105    NSMutableArray *table_apps;
106
107    IBOutlet NSMenu *dock_menu;
108
109    // This is where in the Windows menu we'll start (this will be the index of the separator)
110    NSInteger windows_menu_start;
111
112    int checked_window_item;
113    x_list *pending_apps;
114
115    OSX_BOOL finished_launching;
116    OSX_BOOL can_quit;
117}
118
119- (void) set_window_menu:(NSArray *)list;
120- (void) set_window_menu_check:(NSNumber *)n;
121- (void) set_apps_menu:(NSArray *)list;
122#ifdef XQUARTZ_SPARKLE
123- (void) setup_sparkle;
124- (void) updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
125#endif
126- (void) set_can_quit:(OSX_BOOL)state;
127- (void) server_ready;
128- (OSX_BOOL) application:(NSApplication *)app openFile:(NSString *)filename;
129
130- (IBAction) apps_table_show:(id)sender;
131- (IBAction) apps_table_done:(id)sender;
132- (IBAction) apps_table_new:(id)sender;
133- (IBAction) apps_table_duplicate:(id)sender;
134- (IBAction) apps_table_delete:(id)sender;
135- (IBAction) bring_to_front:(id)sender;
136- (IBAction) close_window:(id)sender;
137- (IBAction) minimize_window:(id)sender;
138- (IBAction) zoom_window:(id)sender;
139- (IBAction) next_window:(id)sender;
140- (IBAction) previous_window:(id)sender;
141- (IBAction) enable_fullscreen_changed:(id)sender;
142- (IBAction) toggle_fullscreen:(id)sender;
143- (IBAction) prefs_changed:(id)sender;
144- (IBAction) prefs_show:(id)sender;
145- (IBAction) quit:(id)sender;
146- (IBAction) x11_help:(id)sender;
147
148@end
149
150#endif /* __OBJC__ */
151
152void X11ControllerMain(int argc, char **argv, char **envp);
153
154#endif /* X11CONTROLLER_H */
155