2003-07-31 23:52:10 +00:00
|
|
|
/** <title>GSDisplayServer</title>
|
|
|
|
|
|
|
|
<abstract>Abstract display server class.</abstract>
|
|
|
|
|
|
|
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Adam Fedor <fedor@gnu.org>
|
|
|
|
Date: Mar 2002
|
|
|
|
|
|
|
|
This file is part of the GNU Objective C User interface library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GSDisplayServer_h_INCLUDE
|
|
|
|
#define _GSDisplayServer_h_INCLUDE
|
|
|
|
|
|
|
|
#include <Foundation/NSObject.h>
|
|
|
|
#include <Foundation/NSGeometry.h>
|
|
|
|
#include <Foundation/NSMapTable.h>
|
|
|
|
#include <Foundation/NSSet.h>
|
|
|
|
|
|
|
|
#include <AppKit/NSDragging.h>
|
|
|
|
#include <AppKit/AppKitDefines.h>
|
|
|
|
#include <AppKit/NSGraphicsContext.h>
|
|
|
|
|
|
|
|
@class NSArray;
|
|
|
|
@class NSMutableDictionary;
|
|
|
|
@class NSEvent;
|
|
|
|
@class NSImage;
|
|
|
|
@class NSMutableArray;
|
|
|
|
@class NSMutableData;
|
|
|
|
@class GSDisplayServer;
|
|
|
|
|
|
|
|
#ifndef NO_GNUSTEP
|
|
|
|
APPKIT_EXPORT GSDisplayServer * GSServerForWindow(NSWindow *window);
|
|
|
|
APPKIT_EXPORT GSDisplayServer * GSCurrentServer(void);
|
|
|
|
|
|
|
|
/* Display attributes */
|
|
|
|
APPKIT_EXPORT NSString * GSDisplayName;
|
|
|
|
APPKIT_EXPORT NSString * GSDisplayNumber;
|
|
|
|
APPKIT_EXPORT NSString * GSScreenNumber;
|
|
|
|
|
|
|
|
@interface GSDisplayServer : NSObject
|
|
|
|
{
|
|
|
|
NSMutableDictionary *server_info;
|
|
|
|
NSMutableArray *event_queue;
|
|
|
|
NSMapTable *drag_types;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ (void) setDefaultServerClass: (Class)aClass;
|
|
|
|
+ (GSDisplayServer *) serverWithAttributes: (NSDictionary *)attributes;
|
|
|
|
+ (void) setCurrentServer: (GSDisplayServer *)server;
|
|
|
|
|
|
|
|
- initWithAttributes: (NSDictionary *)attributes;
|
|
|
|
- (NSDictionary *) attributes;
|
|
|
|
- (void) closeServer;
|
|
|
|
|
|
|
|
/* GL context */
|
|
|
|
- glContextClass;
|
|
|
|
- glPixelFormatClass;
|
|
|
|
|
2004-07-06 20:20:31 +00:00
|
|
|
- (BOOL) handlesWindowDecorations;
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
/* Drag and drop support. */
|
|
|
|
+ (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win;
|
|
|
|
+ (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win;
|
|
|
|
+ (NSCountedSet*) dragTypesForWindow: (NSWindow *)win;
|
|
|
|
- (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win;
|
|
|
|
- (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win;
|
|
|
|
- (NSCountedSet*) dragTypesForWindow: (NSWindow *)win;
|
|
|
|
- (id <NSDraggingInfo>) dragInfo;
|
|
|
|
- (BOOL) slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to;
|
|
|
|
- (void) restrictWindow: (int)win toImage: (NSImage*)image;
|
2004-06-18 23:49:40 +00:00
|
|
|
- (int) findWindowAt: (NSPoint)screenLocation
|
|
|
|
windowRef: (int*)windowRef
|
|
|
|
excluding: (int)win;
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
/* Screen information */
|
|
|
|
- (NSSize) resolutionForScreen: (int)screen;
|
|
|
|
- (NSRect) boundsForScreen: (int)screen;
|
|
|
|
- (NSWindowDepth) windowDepthForScreen: (int)screen;
|
|
|
|
- (const NSWindowDepth *) availableDepthsForScreen: (int)screen;
|
|
|
|
- (NSArray *) screenList;
|
|
|
|
|
|
|
|
- (void *) serverDevice;
|
|
|
|
- (void *) windowDevice: (int)win;
|
|
|
|
|
|
|
|
- (void) beep;
|
2004-11-10 17:12:57 +00:00
|
|
|
|
|
|
|
/* AppIcon/MiniWindow information */
|
|
|
|
- (NSImage *) iconTileImage;
|
|
|
|
- (NSSize) iconSize;
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
/* GNUstep Window operations */
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
@interface GSDisplayServer (WindowOps)
|
|
|
|
- (void) _setWindowOwnedByServer: (int)win;
|
|
|
|
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style;
|
|
|
|
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style
|
|
|
|
: (int)screen;
|
|
|
|
- (void) termwindow: (int) win;
|
2004-07-06 20:20:31 +00:00
|
|
|
|
|
|
|
/* Only if handlesWindowDecorations returns YES. */
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void) stylewindow: (unsigned int) style : (int) win;
|
2004-07-06 20:20:31 +00:00
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void) windowbacking: (NSBackingStoreType)type : (int) win;
|
|
|
|
- (void) titlewindow: (NSString *) window_title : (int) win;
|
|
|
|
- (void) miniwindow: (int) win;
|
|
|
|
- (BOOL) appOwnsMiniwindow;
|
|
|
|
- (void) windowdevice: (int) win;
|
|
|
|
- (void) orderwindow: (int) op : (int) otherWin : (int) win;
|
|
|
|
- (void) movewindow: (NSPoint)loc : (int) win;
|
|
|
|
- (void) placewindow: (NSRect)frame : (int) win;
|
|
|
|
- (NSRect) windowbounds: (int) win;
|
|
|
|
- (void) setwindowlevel: (int) level : (int) win;
|
|
|
|
- (int) windowlevel: (int) win;
|
|
|
|
- (NSArray *) windowlist;
|
|
|
|
- (int) windowdepth: (int) win;
|
|
|
|
- (void) setmaxsize: (NSSize)size : (int) win;
|
|
|
|
- (void) setminsize: (NSSize)size : (int) win;
|
|
|
|
- (void) setresizeincrements: (NSSize)size : (int) win;
|
|
|
|
- (void) flushwindowrect: (NSRect)rect : (int) win;
|
|
|
|
- (void) styleoffsets: (float*) l : (float*) r : (float*) t : (float*) b
|
|
|
|
: (unsigned int) style;
|
|
|
|
- (void) docedited: (int) edited : (int) win;
|
|
|
|
- (void) setinputstate: (int)state : (int)win;
|
|
|
|
- (void) setinputfocus: (int) win;
|
2005-02-12 18:15:25 +00:00
|
|
|
- (void) setalpha: (float)alpha: (int) win;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
- (NSPoint) mouselocation;
|
|
|
|
- (NSPoint) mouseLocationOnScreen: (int)aScreen window: (int *)win;
|
|
|
|
- (BOOL) capturemouse: (int) win;
|
|
|
|
- (void) releasemouse;
|
|
|
|
- (void) hidecursor;
|
|
|
|
- (void) showcursor;
|
|
|
|
- (void) standardcursor: (int) style : (void**) cid;
|
2005-01-21 21:43 Alexander Malmberg <alexander@malmberg.org>
Various whitespace cleanups, comment type fixes, and changes
to avoid warnings from recent versions of gcc.
* Headers/Additions/GNUstepGUI/GSToolbar.h (-_toolbars): Declare.
* Source/NSWindow+Toolbar.m: Remove conflicting declaration of
[NSToolbar -_toolbars].
* Headers/Additions/GNUstepGUI/GSServicesManager.h,
Source/GSServicesMananger.m (-item2title:, -validateMenuItem:):
Adjust argument types.
* Headers/AppKit/NSMenu.h (-validateMenuItem:): Adjust argument
type.
* Source/NSTextView.m (-sizeToFit): Don't use size uninitialized
if neither resizable flags is set.
(-insertText:): Adjust argument type.
* Headers/AppKit/NSResponder.h, Source/NSResponder.m (-insertText:):
Adjust argument type. Document.
* Headers/AppKit/NSView.h: Change type of ivar _window to NSWindow *.
* Source/GSTitleView.m (-mouseDown:): Always initialize
startWindowOrigin.
* Source/NSApplication.m (-setApplicationIconImage:): Add casts
to avoid warnings.
* Source/NSCell.m (-cellSize): Add default: case.
* Source/NSPasteboard.m
([GSFiltered -pasteboard:provideDataForType:]): Detect and warn if we
can't find a filter that will get us the desired type.
* Source/NSProgressIndicator.m: Comment out unused variable 'images'.
* Source/NSBezierPath.m: Declare GSBezierPath fully before using it.
(-bezierPathByFlatteningPath, -bezierPathByReversingPath): Make sure
variables are always initialized.
* Source/NSMenuView.m,
* Source/NSPrintOperation.m,
* Source/NSSplitView.m,
* Source/NSTableHeaderView.m: Make sure variables are always
initialized.
* Source/NSBox.m,
* Source/NSImageview.m,
* Source/NSText.m,
* Source/NSTextStorage.m: Add missing includes.
* Source/GSKeyBindingTable.m,
* Source/GSLayoutManager.m,
* Source/NSBitmapImageRep+PNM.m,
* Source/NSBundleAdditions.m,
* Source/NSLayoutManager.m,
* Source/nsimage-tiff.h,
* Source/tiff.m,
* Headers/Additions/GNUstepGUI/GSDisplayServer.h,
* Source/GSDisplayServer.m: Change signedness of various variables.
* Source/NSPanel.m (-sendEvent:): Remove.
* Source/NSWindow.m (-becomesKeyOnlyIfNeeded): New method.
(-_sendEvent:becomesKeyOnlyIfNeeded:): Remove. Move code ...
(-sendEvent:): ... here. Use -becomesKeyOnlyIfNeeded instead
of the argument.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20590 72102866-910b-0410-8b05-ffd578937521
2005-01-21 20:39:18 +00:00
|
|
|
- (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int) colors
|
|
|
|
: (const unsigned char *) image : (void**) cid;
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
/* GNUstep Event Operations */
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
@interface GSDisplayServer (EventOps)
|
|
|
|
- (NSEvent*) getEventMatchingMask: (unsigned)mask
|
|
|
|
beforeDate: (NSDate*)limit
|
|
|
|
inMode: (NSString*)mode
|
|
|
|
dequeue: (BOOL)flag;
|
|
|
|
- (void) discardEventsMatchingMask: (unsigned)mask
|
|
|
|
beforeEvent: (NSEvent*)limit;
|
|
|
|
- (void) postEvent: (NSEvent*)anEvent atStart: (BOOL)flag;
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
static inline NSEvent*
|
|
|
|
DPSGetEvent(GSDisplayServer *ctxt, unsigned mask, NSDate* limit, NSString *mode)
|
|
|
|
{
|
|
|
|
return [ctxt getEventMatchingMask: mask beforeDate: limit inMode: mode
|
|
|
|
dequeue: YES];
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline NSEvent*
|
|
|
|
DPSPeekEvent(GSDisplayServer *ctxt, unsigned mask, NSDate* limit, NSString *mode)
|
|
|
|
{
|
|
|
|
return [ctxt getEventMatchingMask: mask beforeDate: limit inMode: mode
|
|
|
|
dequeue: NO];
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
DPSDiscardEvents(GSDisplayServer *ctxt, unsigned mask, NSEvent* limit)
|
|
|
|
{
|
|
|
|
[ctxt discardEventsMatchingMask: mask beforeEvent: limit];
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
DPSPostEvent(GSDisplayServer *ctxt, NSEvent* anEvent, BOOL atStart)
|
|
|
|
{
|
|
|
|
[ctxt postEvent: anEvent atStart: atStart];
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* NO_GNUSTEP */
|
|
|
|
#endif
|