b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync//
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync// XServer.h
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync//
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * copy of this software and associated documentation files (the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * "Software"), to deal in the Software without restriction, including
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * without limitation the rights to use, copy, modify, merge, publish,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * distribute, sublicense, and/or sell copies of the Software, and to
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * permit persons to whom the Software is furnished to do so, subject to
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * the following conditions:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * The above copyright notice and this permission notice shall be included
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * in all copies or substantial portions of the Software.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Except as contained in this notice, the name(s) of the above copyright
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * holders shall not be used in advertising or otherwise to promote the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * sale, use or other dealings in this Software without prior written
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * authorization.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.4 2005/04/20 12:25:19 daniels Exp $ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.16 2003/11/23 06:04:01 torrey Exp $ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define BOOL xBOOL
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include <X11/Xproto.h>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#undef BOOL
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#import <Cocoa/Cocoa.h>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync@interface XServer : NSObject {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync // Server state
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int serverState;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync NSRecursiveLock *serverLock;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync NSMutableArray *pendingClients;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BOOL serverVisible;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BOOL rootlessMenuBarVisible;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BOOL queueShowServer;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BOOL quitWithoutQuery;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BOOL pendingAppQuitReply;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync UInt32 mouseState;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned short swallowedKey;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BOOL sendServerEvents;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BOOL x11Active;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync // Aqua interface
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSWindow *modeWindow;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSButton *startupModeButton;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSButton *startFullScreenButton;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSButton *startRootlessButton;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSWindow *helpWindow;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSButton *startupHelpButton;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSPanel *switchWindow;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync // Menu elements setable by Apple-WM extension
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSMenu *windowMenu;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSMenuItem *windowSeparator;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync IBOutlet NSMenu *dockMenu;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int checkedWindowItem;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync}
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (id)init;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (BOOL)translateEvent:(NSEvent *)anEvent;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (NSString *)makeSafePath:(NSString *)path;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (BOOL)loadDisplayBundle;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)startX;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)finishStartX;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (BOOL)startXClients;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)runClient:(NSString *)filename;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)run;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)toggle;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)showServer:(BOOL)show;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)forceShowServer:(BOOL)show;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)setRootClip:(BOOL)enable;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)readPasteboard;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)writePasteboard;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)quitServer;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)sendXEvent:(xEvent *)xe;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)sendShowHide:(BOOL)show;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)clientProcessDone:(int)clientStatus;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)activateX11:(BOOL)state;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)windowBecameKey:(NSNotification *)notification;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)setX11WindowList:(NSArray *)list;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)setX11WindowCheck:(NSNumber *)nn;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync// Aqua interface actions
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)startFullScreen:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)startRootless:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)closeHelpAndShow:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)showSwitchPanel:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)showAction:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)itemSelected:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)nextWindow:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)previousWindow:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)performClose:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)performMiniaturize:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)performZoom:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)bringAllToFront:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (IBAction)copy:(id)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync// NSApplication delegate
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)applicationWillTerminate:(NSNotification *)aNotification;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)applicationDidHide:(NSNotification *)aNotification;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)applicationDidUnhide:(NSNotification *)aNotification;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)applicationWillResignActive:(NSNotification *)aNotification;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync// NSPort delegate
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync- (void)handlePortMessage:(NSPortMessage *)portMessage;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync@end
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync// X server states
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncenum {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync server_NotStarted,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync server_Starting,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync server_Running,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync server_Quitting,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync server_Done
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync};