1706f2543Smrg/* X11Controller.h -- connect the IB ui
2706f2543Smrg
3706f2543Smrg   Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
4706f2543Smrg
5706f2543Smrg   Permission is hereby granted, free of charge, to any person
6706f2543Smrg   obtaining a copy of this software and associated documentation files
7706f2543Smrg   (the "Software"), to deal in the Software without restriction,
8706f2543Smrg   including without limitation the rights to use, copy, modify, merge,
9706f2543Smrg   publish, distribute, sublicense, and/or sell copies of the Software,
10706f2543Smrg   and to permit persons to whom the Software is furnished to do so,
11706f2543Smrg   subject to the following conditions:
12706f2543Smrg
13706f2543Smrg   The above copyright notice and this permission notice shall be
14706f2543Smrg   included in all copies or substantial portions of the Software.
15706f2543Smrg
16706f2543Smrg   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17706f2543Smrg   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18706f2543Smrg   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19706f2543Smrg   NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
20706f2543Smrg   HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21706f2543Smrg   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22706f2543Smrg   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23706f2543Smrg   DEALINGS IN THE SOFTWARE.
24706f2543Smrg
25706f2543Smrg   Except as contained in this notice, the name(s) of the above
26706f2543Smrg   copyright holders shall not be used in advertising or otherwise to
27706f2543Smrg   promote the sale, use or other dealings in this Software without
28706f2543Smrg   prior written authorization. */
29706f2543Smrg
30706f2543Smrg#ifndef X11CONTROLLER_H
31706f2543Smrg#define X11CONTROLLER_H 1
32706f2543Smrg
33706f2543Smrg#ifdef HAVE_DIX_CONFIG_H
34706f2543Smrg#include <dix-config.h>
35706f2543Smrg#endif
36706f2543Smrg
37706f2543Smrg#if __OBJC__
38706f2543Smrg
39706f2543Smrg#include "sanitizedCocoa.h"
40706f2543Smrg#include "xpr/x-list.h"
41706f2543Smrg
42706f2543Smrg#ifdef XQUARTZ_SPARKLE
43706f2543Smrg#define BOOL OSX_BOOL
44706f2543Smrg#include <Sparkle/SUUpdater.h>
45706f2543Smrg#undef BOOL
46706f2543Smrg#endif
47706f2543Smrg
48706f2543Smrg#ifndef NSINTEGER_DEFINED
49706f2543Smrg#if __LP64__ || NS_BUILD_32_LIKE_64
50706f2543Smrgtypedef long NSInteger;
51706f2543Smrgtypedef unsigned long NSUInteger;
52706f2543Smrg#else
53706f2543Smrgtypedef int NSInteger;
54706f2543Smrgtypedef unsigned int NSUInteger;
55706f2543Smrg#endif
56706f2543Smrg#endif
57706f2543Smrg
58706f2543Smrg@interface X11Controller : NSObject
59706f2543Smrg#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
60706f2543Smrg<NSTableViewDataSource>
61706f2543Smrg#endif
62706f2543Smrg{
63706f2543Smrg    IBOutlet NSPanel *prefs_panel;
64706f2543Smrg
65706f2543Smrg    IBOutlet NSButton *fake_buttons;
66706f2543Smrg    IBOutlet NSButton *enable_fullscreen;
67706f2543Smrg    IBOutlet NSButton *enable_fullscreen_menu;
68706f2543Smrg    IBOutlet NSTextField *enable_fullscreen_menu_text;
69706f2543Smrg    IBOutlet NSButton *enable_keyequivs;
70706f2543Smrg    IBOutlet NSButton *sync_keymap;
71706f2543Smrg    IBOutlet NSButton *option_sends_alt;
72706f2543Smrg    IBOutlet NSButton *scroll_in_device_direction;
73706f2543Smrg    IBOutlet NSButton *click_through;
74706f2543Smrg    IBOutlet NSButton *focus_follows_mouse;
75706f2543Smrg    IBOutlet NSButton *focus_on_new_window;
76706f2543Smrg    IBOutlet NSButton *enable_auth;
77706f2543Smrg    IBOutlet NSButton *enable_tcp;
78706f2543Smrg    IBOutlet NSButton *sync_pasteboard;
79706f2543Smrg    IBOutlet NSButton *sync_pasteboard_to_clipboard;
80706f2543Smrg    IBOutlet NSButton *sync_pasteboard_to_primary;
81706f2543Smrg    IBOutlet NSButton *sync_clipboard_to_pasteboard;
82706f2543Smrg    IBOutlet NSButton *sync_primary_immediately;
83706f2543Smrg    IBOutlet NSTextField *sync_text1;
84706f2543Smrg    IBOutlet NSTextField *sync_text2;
85706f2543Smrg    IBOutlet NSPopUpButton *depth;
86706f2543Smrg
87706f2543Smrg    IBOutlet NSMenuItem *window_separator;
88706f2543Smrg    // window_separator is DEPRECATED due to this radar:
89706f2543Smrg    // <rdar://problem/7088335> NSApplication releases the separator in the Windows menu even though it's an IBOutlet
90706f2543Smrg    // It is kept around for localization compatability and is subject to removal "eventually"
91706f2543Smrg    // If it is !NULL (meaning it is in the nib), it is removed from the menu and released
92706f2543Smrg
93706f2543Smrg    IBOutlet NSMenuItem *x11_about_item;
94706f2543Smrg    IBOutlet NSMenuItem *dock_window_separator;
95706f2543Smrg    IBOutlet NSMenuItem *apps_separator;
96706f2543Smrg    IBOutlet NSMenuItem *toggle_fullscreen_item;
97706f2543Smrg#ifdef XQUARTZ_SPARKLE
98706f2543Smrg    NSMenuItem *check_for_updates_item; // Programatically enabled
99706f2543Smrg#endif
100706f2543Smrg    IBOutlet NSMenuItem *copy_menu_item;
101706f2543Smrg    IBOutlet NSMenu *dock_apps_menu;
102706f2543Smrg    IBOutlet NSTableView *apps_table;
103706f2543Smrg
104706f2543Smrg    NSArray *apps;
105706f2543Smrg    NSMutableArray *table_apps;
106706f2543Smrg
107706f2543Smrg    IBOutlet NSMenu *dock_menu;
108706f2543Smrg
109706f2543Smrg    // This is where in the Windows menu we'll start (this will be the index of the separator)
110706f2543Smrg    NSInteger windows_menu_start;
111706f2543Smrg
112706f2543Smrg    int checked_window_item;
113706f2543Smrg    x_list *pending_apps;
114706f2543Smrg
115706f2543Smrg    OSX_BOOL finished_launching;
116706f2543Smrg    OSX_BOOL can_quit;
117706f2543Smrg}
118706f2543Smrg
119706f2543Smrg- (void) set_window_menu:(NSArray *)list;
120706f2543Smrg- (void) set_window_menu_check:(NSNumber *)n;
121706f2543Smrg- (void) set_apps_menu:(NSArray *)list;
122706f2543Smrg#ifdef XQUARTZ_SPARKLE
123706f2543Smrg- (void) setup_sparkle;
124706f2543Smrg- (void) updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
125706f2543Smrg#endif
126706f2543Smrg- (void) set_can_quit:(OSX_BOOL)state;
127706f2543Smrg- (void) server_ready;
128706f2543Smrg- (OSX_BOOL) application:(NSApplication *)app openFile:(NSString *)filename;
129706f2543Smrg
130706f2543Smrg- (IBAction) apps_table_show:(id)sender;
131706f2543Smrg- (IBAction) apps_table_done:(id)sender;
132706f2543Smrg- (IBAction) apps_table_new:(id)sender;
133706f2543Smrg- (IBAction) apps_table_duplicate:(id)sender;
134706f2543Smrg- (IBAction) apps_table_delete:(id)sender;
135706f2543Smrg- (IBAction) bring_to_front:(id)sender;
136706f2543Smrg- (IBAction) close_window:(id)sender;
137706f2543Smrg- (IBAction) minimize_window:(id)sender;
138706f2543Smrg- (IBAction) zoom_window:(id)sender;
139706f2543Smrg- (IBAction) next_window:(id)sender;
140706f2543Smrg- (IBAction) previous_window:(id)sender;
141706f2543Smrg- (IBAction) enable_fullscreen_changed:(id)sender;
142706f2543Smrg- (IBAction) toggle_fullscreen:(id)sender;
143706f2543Smrg- (IBAction) prefs_changed:(id)sender;
144706f2543Smrg- (IBAction) prefs_show:(id)sender;
145706f2543Smrg- (IBAction) quit:(id)sender;
146706f2543Smrg- (IBAction) x11_help:(id)sender;
147706f2543Smrg
148706f2543Smrg@end
149706f2543Smrg
150706f2543Smrg#endif /* __OBJC__ */
151706f2543Smrg
152706f2543Smrgvoid X11ControllerMain(int argc, char **argv, char **envp);
153706f2543Smrg
154706f2543Smrg#endif /* X11CONTROLLER_H */
155