Up
Authors
- Adam Fedor (
fedor@gnu.org
)
-
Abstract display server class.
Copyright: (C) 2002 Free Software Foundation, Inc.
This is an abstract class which provides a framework for a device independant window server. A window server handles the very basic control of the computer display and input. This includes basic window creation and handling, event handling, cursors, and providing miscellaneous information about the display.
Typically a backend library will provide a concrete subclass which implements the device specific methods described below.
In almost all cases, you should not call these methods directly in an application. You should use the equivalent methods available elsewhere in the library (e.g. NSWindow, NSScreen, etc).
- Declared in:
- GNUstepGUI/GSDisplayServer.h
Availability: GuiAdditions 0.0.0
Description forthcoming.
Instance Variables
Method summary
+ (BOOL)
addDragTypes: (NSArray*)types
toWindow: (NSWindow*)win;
Availability: GuiAdditions 0.0.0
+ (NSCountedSet*)
dragTypesForWindow: (NSWindow*)win;
Availability: GuiAdditions 0.0.0
+ (BOOL)
removeDragTypes: (NSArray*)types
fromWindow: (NSWindow*)win;
Availability: GuiAdditions 0.0.0
+ (
GSDisplayServer*)
serverWithAttributes: (NSDictionary*)attributes;
Availability: GuiAdditions 0.0.0
Create a window server with attributes, which contains key/value pairs which describe the specifics of how the window server is to be initialized. Typically these values are specific to the concrete implementation. The current set of attributes that can be used with GSDisplayServer is.
-
GSDisplayName
-
GSDisplayNumber
-
GSScreenNumber
GSDisplayName is window server specific and shouldn't be used when creating a GSDisplayServer (although you can retrieve the value with the -attributes
method). On X-Windows the value might be set to something like "host:d.s" where host is the host name, d is the display number and s is the screen number. GSDisplayNumber indicates the number of the display to open. GSScreenNumber indicates the number of the screen to display on. If not explicitly set, these attributes may be taked from environment variables or from other operating specific information.
In almost all applications one would only create a single instance of a window server. Although it is possible, it is unlikely that you would need more than one window server (and you would have to be very careful how you handled window creation and events in this case).
+ (void)
setCurrentServer: (
GSDisplayServer*)server;
Availability: GuiAdditions 0.0.0
Sets the current server that will be handling windows, events, etc. This method must be called after a window server is created in order to make it available to the rest of the GUI library
+ (void)
setDefaultServerClass: (Class)aClass;
Availability: GuiAdditions 0.0.0
Set the concrete subclass that will provide the device dependant implementation.
- (BOOL)
addDragTypes: (NSArray*)types
toWindow: (NSWindow*)win;
Availability: GuiAdditions 0.0.0
Add (increment count by 1) each drag type to those registered for the window. If this results in a change to the types registered in the counted set, return YES
, otherwise return NO
. Subclasses should override this method, call 'super' and take appropriate action if the method returns 'YES'.
- (NSDictionary*)
attributes;
Availability: GuiAdditions 0.0.0
Return information used to create the server
- (const NSWindowDepth*)
availableDepthsForScreen: (int)screen;
Availability: GuiAdditions 0.0.0
Returns a null terminated list of possible window depths for screen.
- (void)
beep;
Availability: GuiAdditions 0.0.0
Play the System Beep
- (NSRect)
boundsForScreen: (int)screen;
Availability: GuiAdditions 0.0.0
Returns the bounds, in pixels, for the indicated screen of the display.
- (void)
closeServer;
Availability: GuiAdditions 0.0.0
Causes the server to disconnect from the display. If the receiver is the current server, it removes itself and sets the current server to nil
. Sending any more messages to the receiver after this is likely to cause severe problems and probably crash the application.
- (id
) dragInfo;
Availability: GuiAdditions 0.0.0
Returns an instance of a class which implements the NSDraggingInfo protocol.
- (NSCountedSet*)
dragTypesForWindow: (NSWindow*)win;
Availability: GuiAdditions 0.0.0
Returns the drag types set for the window win.
- (int)
findWindowAt: (NSPoint)screenLocation
windowRef: (int*)windowRef
excluding: (int)win;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- (id)
glContextClass;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- (id)
glPixelFormatClass;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- (BOOL)
handlesWindowDecorations;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- (NSSize)
iconSize;
Availability: GuiAdditions 0.0.0
Returns the size of icons and miniwindows for screen.
- (NSImage*)
iconTileImage;
Availability: GuiAdditions 0.0.0
Returns a display dependent NSImage which will be used as the background image for AppIcons and MiniWindows. Under Windowmaker, for example this could be a user specified gradient.
- (id)
initWithAttributes: (NSDictionary*)attributes;
Availability: GuiAdditions 0.0.0
This is a designated initialiser for the class.
Initializes the server. This typically causes the receiver to connect to the display (e.g. XOpenDisplay () on an X-Windows server).
- (BOOL)
removeDragTypes: (NSArray*)types
fromWindow: (NSWindow*)win;
Availability: GuiAdditions 0.0.0
Remove (decrement count by 1) each drag type from those registered for the window. If this results in a change to the types registered in the counted set, return YES
, otherwise return NO
. If given 'nil' as the array of types, remove ALL. Subclasses should override this method, call 'super' and take appropriate action if the method returns 'YES'.
- (NSSize)
resolutionForScreen: (int)screen;
Availability: GuiAdditions 0.0.0
Returns the resolution, in points, for the indicated screen of the display.
- (void)
restrictWindow: (int)win
toImage: (NSImage*)image;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- (NSArray*)
screenList;
Availability: GuiAdditions 0.0.0
Returns an array of NSNumbers, where each number describes a screen that is available on this display. The default screen is listed first.
- (void*)
serverDevice;
Availability: GuiAdditions 0.0.0
Returns a display dependant pointer that describes the internal connection to the display. On X-Windows, for example, this is a pointer to the Display
variable.
- (BOOL)
slideImage: (NSImage*)image
from: (NSPoint)from
to: (NSPoint)to;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- (NSWindowDepth)
windowDepthForScreen: (int)screen;
Availability: GuiAdditions 0.0.0
Returns the default depth of windows that are created on screen.
- (void*)
windowDevice: (int)win;
Availability: GuiAdditions 0.0.0
Returns a display dependant pointer that describes the internal window representation for win. On X-Windows, for example, this is a pointer to the Window
variable.
Instance Variables for GSDisplayServer Class
@protected NSMapTable* drag_types;
Description forthcoming.
@protected NSMutableArray* event_queue;
Description forthcoming.
@protected NSMutableDictionary* server_info;
Description forthcoming.
- Declared in:
- GNUstepGUI/GSDisplayServer.h
Availability: GuiAdditions 0.0.0
Description forthcoming.
Method summary
- (void)
discardEventsMatchingMask: (unsigned)mask
beforeEvent: (NSEvent*)limit;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- (NSEvent*)
getEventMatchingMask: (unsigned)mask
beforeDate: (NSDate*)limit
inMode: (NSString*)mode
dequeue: (BOOL)flag;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- (void)
postEvent: (NSEvent*)anEvent
atStart: (BOOL)flag;
Availability: GuiAdditions 0.0.0
Description forthcoming.
- Declared in:
- GNUstepGUI/GSDisplayServer.h
Availability: GuiAdditions 0.0.0
Description forthcoming.
Method summary
- (void)
_setWindowOwnedByServer: (int)win;
Availability: GuiAdditions 0.0.0
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
Tells the receiver that it owns the window described by win. Concrete subclasses must call this function when creating a window. Do not call this method in any other case, particularly for a window that has already been created
- (BOOL)
appOwnsMiniwindow;
Availability: GuiAdditions 0.0.0
Returns YES
if the application should create the miniwindow counterpart to the full size window and own it. Some display systems handle the miniwindow themselves. In this case the backend subclass should override this method to return NO
.
- (BOOL)
capturemouse: (int)win;
Availability: GuiAdditions 0.0.0
Grabs the pointer device so that all future mouse events will be directed only to the window
win. If successful, the return value is
YES
and this message must be balanced by a
-releasemouse
message.
- (void)
docedited: (int)edited
: (int)win;
Availability: GuiAdditions 0.0.0
Sets the document edited flag for the window
- (void)
flushwindowrect: (NSRect)rect
: (int)win;
Availability: GuiAdditions 0.0.0
Causes buffered graphics to be flushed to the screen
- (void)
hidecursor;
Availability: GuiAdditions 0.0.0
Hides the cursor
- (void)
imagecursor: (NSPoint)hotp
: (int)w
: (int)h
: (int)colors
: (const unsigned char*)image
: (void**)cid;
Availability: GuiAdditions 0.0.0
Create a cursor from an image. Returns a pointer to the internal device representation that can be used later to make this cursor the current one
- (void)
miniwindow: (int)win;
Availability: GuiAdditions 0.0.0
Miniaturizes the window
- (NSPoint)
mouseLocationOnScreen: (int)aScreen
window: (int*)win;
Availability: GuiAdditions 0.0.0
Returns the current mouse location on
aScreen. If the pointer is not on
aScreen, this method acts like
-mouselocation
. If
aScreen is -1, then the location of the mouse on any screen is returned. The
win pointer returns the window number of the GNUstep window that the mouse is in or 0 if it is not in a window.
- (NSPoint)
mouselocation;
Availability: GuiAdditions 0.0.0
Returns the current mouse location on the default screen. If the pointer is not on the default screen, an invalid point (-1,-1} is returned.
- (void)
movewindow: (NSPoint)loc
: (int)win;
Availability: GuiAdditions 0.0.0
Moves the bottom left cornder of the window to loc
- (void)
orderwindow: (int)op
: (int)otherWin
: (int)win;
Availability: GuiAdditions 0.0.0
Causes the window to be ordered onto or off the screen depending on the value of op. The window is ordered relative to otherWin. The window will never be ordered in front of the current key/main window except in the special case where otherWin is negative (This is a special feature that [NSWindow -orderWindow:relativeTo:]
uses to place the window correctly).
- (void)
placewindow: (NSRect)frame
: (int)win;
Availability: GuiAdditions 0.0.0
Moves and resizes the window on the screen as described by frame.
- (void)
releasemouse;
Availability: GuiAdditions 0.0.0
- (void)
setalpha: (float)alpha
: (int)win;
Availability: GuiAdditions 0.0.0
Sets the transparancy value for the whole window
- (void)
setcursorcolor: (NSColor*)fg
: (NSColor*)bg
: (void*)cid;
Availability: GuiAdditions 0.0.0
Set the cursor given by the cid representation as being the current cursor. The cursor has a foreground color fg and a background color bg. To keep the default color for the cursor, pass nil
for fg and bg.
- (void)
setinputfocus: (int)win;
Availability: GuiAdditions 0.0.0
Forces focus to the window so that all key events are sent to this window
- (void)
setinputstate: (int)state
: (int)win;
Availability: GuiAdditions 0.0.0
Sets the input state for the window given by the GSWindowInputState constant. Instructs the window manager that the specified window is 'key', 'main', or just a normal window.
- (void)
setmaxsize: (NSSize)size
: (int)win;
Availability: GuiAdditions 0.0.0
Set the maximum size of the window
- (void)
setminsize: (NSSize)size
: (int)win;
Availability: GuiAdditions 0.0.0
Set the minimum size of the window
- (void)
setresizeincrements: (NSSize)size
: (int)win;
Availability: GuiAdditions 0.0.0
Set the resize incremenet of the window
- (void)
setwindowlevel: (int)level
: (int)win;
Availability: GuiAdditions 0.0.0
Set the level of the window as in [NSWindow -setLevel]
- (void)
showcursor;
Availability: GuiAdditions 0.0.0
Show a previously hidden cursor
- (void)
standardcursor: (int)style
: (void**)cid;
Availability: GuiAdditions 0.0.0
Create a standard cursor (such as an arror or IBeam). Returns a pointer to the internal device representation that can be used later to make this cursor the current one
- (void)
styleoffsets: (float*)l
: (float*)r
: (float*)t
: (float*)b
: (unsigned int)style;
Availability: GuiAdditions 0.0.0
Returns the dimensions of window decorations added outside the drawable window frame by a window manager or equivalent. For instance, t gives the height of the title bar for the window. The values returned may be approximations. If handlesWindowDecorations returns NO
, there are no decorations outside the drawable window frame and this method shouldn't be called.
- (void)
stylewindow: (unsigned int)style
: (int)win;
Availability: GuiAdditions 0.0.0
Sets the style of the window. See [NSWindow -styleMask]
for a description of the available styles
- (void)
termwindow: (int)win;
Availability: GuiAdditions 0.0.0
Destroys the representation of the window and frees and memory associated with it.
- (void)
titlewindow: (NSString*)window_title
: (int)win;
Availability: GuiAdditions 0.0.0
Sets the window title
- (int)
window: (NSRect)frame
: (NSBackingStoreType)type
: (unsigned int)style;
Availability: GuiAdditions 0.0.0
Creates a window whose location and size is described by
frame and whose backing store is described by
type. This window is not mapped to the screen by this call. Note that
frame is the
frame of the drawable window and does not include any external window decorations. If handlesWindowDecorations returns
YES
, a window manager (or something equivalent) might add decorations outside the drawable window. Use
-styleoffsets:::::
to determine the extent of those decorations.
- (int)
window: (NSRect)frame
: (NSBackingStoreType)type
: (unsigned int)style
: (int)screen;
Availability: GuiAdditions 0.0.0
Like
-window:::
only there is an additional argument to specify which
screen the window will display on
- (void)
windowbacking: (NSBackingStoreType)type
: (int)win;
Availability: GuiAdditions 0.0.0
Changes window's the backing store to type
- (NSRect)
windowbounds: (int)win;
Availability: GuiAdditions 0.0.0
Returns the frame of the window on the screen
- (int)
windowdepth: (int)win;
Availability: GuiAdditions 0.0.0
Returns the depth of the window
- (void)
windowdevice: (int)win;
Availability: GuiAdditions 0.0.0
Sets the window device information for the current NSGraphicsContext, typically by calling [NSGraphicsContext -GSSetDevice:::]
, although depending on the concrete implmentation, more information than this may need to be exchanged.
- (int)
windowlevel: (int)win;
Availability: GuiAdditions 0.0.0
Returns the window level as in [NSWindow -level]
- (NSArray*)
windowlist;
Availability: GuiAdditions 0.0.0
Returns the list of windows that the server controls
Up