initial commit
[profile/ivi/xorg-x11-server.git] / hw / xquartz / X11Controller.h
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
50 typedef long NSInteger;
51 typedef unsigned long NSUInteger;
52 #else
53 typedef int NSInteger;
54 typedef 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 NSButton *use_sysbeep;
69     IBOutlet NSButton *enable_keyequivs;
70     IBOutlet NSButton *sync_keymap;
71     IBOutlet NSButton *option_sends_alt;
72     IBOutlet NSButton *click_through;
73     IBOutlet NSButton *focus_follows_mouse;
74     IBOutlet NSButton *focus_on_new_window;
75     IBOutlet NSButton *enable_auth;
76     IBOutlet NSButton *enable_tcp;
77     IBOutlet NSButton *sync_pasteboard;
78     IBOutlet NSButton *sync_pasteboard_to_clipboard;
79     IBOutlet NSButton *sync_pasteboard_to_primary;
80     IBOutlet NSButton *sync_clipboard_to_pasteboard;
81     IBOutlet NSButton *sync_primary_immediately;
82     IBOutlet NSTextField *sync_text1;
83     IBOutlet NSTextField *sync_text2;
84     IBOutlet NSPopUpButton *depth;
85
86     IBOutlet NSMenuItem *window_separator;
87     // window_separator is DEPRECATED due to this radar:
88     // <rdar://problem/7088335> NSApplication releases the separator in the Windows menu even though it's an IBOutlet
89     // It is kept around for localization compatability and is subject to removal "eventually"
90     // If it is !NULL (meaning it is in the nib), it is removed from the menu and released
91
92     IBOutlet NSMenuItem *x11_about_item;
93     IBOutlet NSMenuItem *dock_window_separator;
94     IBOutlet NSMenuItem *apps_separator;
95     IBOutlet NSMenuItem *toggle_fullscreen_item;
96 #ifdef XQUARTZ_SPARKLE
97     NSMenuItem *check_for_updates_item; // Programatically enabled
98 #endif
99     IBOutlet NSMenuItem *copy_menu_item;
100     IBOutlet NSMenu *dock_apps_menu;
101     IBOutlet NSTableView *apps_table;
102
103     NSArray *apps;
104     NSMutableArray *table_apps;
105
106     IBOutlet NSMenu *dock_menu;
107     
108     // This is where in the Windows menu we'll start (this will be the index of the separator)
109     NSInteger windows_menu_start;
110
111     int checked_window_item;
112     x_list *pending_apps;
113
114     OSX_BOOL finished_launching;
115     OSX_BOOL can_quit;
116 }
117
118 - (void) set_window_menu:(NSArray *)list;
119 - (void) set_window_menu_check:(NSNumber *)n;
120 - (void) set_apps_menu:(NSArray *)list;
121 #ifdef XQUARTZ_SPARKLE
122 - (void) setup_sparkle;
123 - (void) updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
124 #endif
125 - (void) set_can_quit:(OSX_BOOL)state;
126 - (void) server_ready;
127 - (OSX_BOOL) application:(NSApplication *)app openFile:(NSString *)filename;
128
129 - (IBAction) apps_table_show:(id)sender;
130 - (IBAction) apps_table_done:(id)sender;
131 - (IBAction) apps_table_new:(id)sender;
132 - (IBAction) apps_table_duplicate:(id)sender;
133 - (IBAction) apps_table_delete:(id)sender;
134 - (IBAction) bring_to_front:(id)sender;
135 - (IBAction) close_window:(id)sender;
136 - (IBAction) minimize_window:(id)sender;
137 - (IBAction) zoom_window:(id)sender;
138 - (IBAction) next_window:(id)sender;
139 - (IBAction) previous_window:(id)sender;
140 - (IBAction) enable_fullscreen_changed:(id)sender;
141 - (IBAction) toggle_fullscreen:(id)sender;
142 - (IBAction) prefs_changed:(id)sender;
143 - (IBAction) prefs_show:(id)sender;
144 - (IBAction) quit:(id)sender;
145 - (IBAction) x11_help:(id)sender;
146
147 @end
148
149 #endif /* __OBJC__ */
150
151 void X11ControllerMain(int argc, char **argv, char **envp);
152
153 #endif /* X11CONTROLLER_H */