libs-gui/Documentation/gsdoc/GSDisplayServer.gsdoc
Adam Fedor 228bb345cf Update docs
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13335 72102866-910b-0410-8b05-ffd578937521
2002-04-03 16:59:43 +00:00

853 lines
29 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.7//EN" "http://www.gnustep.org/gsdoc-0_6_7.xml">
<gsdoc base="GSDisplayServer" up="Gui">
<head>
<title>GSDisplayServer</title>
<author name="Adam Fedor">
<email address="fedor@gnu.org">
fedor@gnu.org
</email>
</author>
<abstract>Abstract display server class.</abstract>
<copy>2002 Free Software Foundation, Inc.</copy>
</head>
<body>
<front><contents /></front>
<chapter>
<heading>GSDisplayServer</heading>
<p>
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.
</p>
<p>
Typically a backend library will provide a concrete
subclass which implements the device specific methods
described below.
</p>
<p>
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).
</p>
<class name="GSDisplayServer" super="NSObject">
<declared>AppKit/GSDisplayServer.h</declared>
<desc>
</desc>
<method type="BOOL" factory="yes">
<sel>addDragTypes:</sel>
<arg type="NSArray*">types</arg>
<sel>toWindow:</sel>
<arg type="NSWindow*">win</arg>
<desc>
Convienience method that calls
<ref type="method" id="-addDragTypes:toWindow:">
-addDragTypes:toWindow:
</ref>
using the server that controls <var>win</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSCountedSet*" factory="yes">
<sel>dragTypesForWindow:</sel>
<arg type="NSWindow*">win</arg>
<desc>
Convienience method that calls
<ref type="method" id="-dragTypesForWindow:">
-dragTypesForWindow:
</ref>
using the server that controls <var>win</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="BOOL" factory="yes">
<sel>removeDragTypes:</sel>
<arg type="NSArray*">types</arg>
<sel>fromWindow:</sel>
<arg type="NSWindow*">win</arg>
<desc>
Convienience method that calls
<ref type="method" id="-removeDragTypes:fromWindow:">
-removeDragTypes:fromWindow:
</ref>
using the server that controls <var>win</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="GSDisplayServer*" factory="yes">
<sel>serverWithAttributes:</sel>
<arg type="NSDictionary*">attributes</arg>
<desc>
<p>
Create a window server with <var>attributes</var>,
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.
Currently there are no standard set of
<var>attributes</var> defined for GSDisplayServer.
</p>
<p>
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).
</p>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void" factory="yes">
<sel>setCurrentServer:</sel>
<arg type="GSDisplayServer*">server</arg>
<desc>
Sets the current <var>server</var> that will be
handling windows, events, etc. This method must be
called after a window <var>server</var> is created
in order to make it available to the rest of the GUI
library
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void" factory="yes">
<sel>setDefaultServerClass:</sel>
<arg type="Class">aClass</arg>
<desc>
Set the concrete subclass that will provide the device
dependant implementation.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="BOOL">
<sel>addDragTypes:</sel>
<arg type="NSArray*">types</arg>
<sel>toWindow:</sel>
<arg type="NSWindow*">win</arg>
<desc>
Add (increment count by 1) each drag type to those
registered for the window. If this results in a
change to the <var>types</var> registered in the
counted set, return <code>YES</code>, otherwise
return <code>NO</code>. Subclasses should override
this method, call 'super' and take appropriate action
if the method returns 'YES'.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSDictionary*">
<sel>attributes</sel>
<desc>
Return information used to create the server
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="const NSWindowDepth*">
<sel>availableDepthsForScreen:</sel>
<arg type="int">screen</arg>
<desc>
Returns a null terminated list of possible window
depths for <var>screen</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSRect">
<sel>boundsForScreen:</sel>
<arg type="int">screen</arg>
<desc>
Retuns the bounds, in pixels, for the indicated
<var>screen</var> of the display.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>closeServer</sel>
<desc>
Causes the server to disconnect from the display. If
the receiver is the current server, it removes itself
and sets the current server to <code>nil</code>.
Sending any more messages to the receiver after
this is likely to cause severe problems and probably
crash the application.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="id&lt;NSDraggingInfo&gt;">
<sel>dragInfo</sel>
<desc>
Returns an instance of a class which implements the
NSDraggingInfo protocol.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSCountedSet*">
<sel>dragTypesForWindow:</sel>
<arg type="NSWindow*">win</arg>
<desc>
Returns the drag types set for the window
<var>win</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="id" init="yes">
<sel>initWithAttributes:</sel>
<arg type="NSDictionary*">attributes</arg>
<desc>
Initializes the server. This typically causes
the receiver to <em>connect</em> to the display (e.g.
XOpenDisplay() on an X-Windows server).
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="BOOL">
<sel>removeDragTypes:</sel>
<arg type="NSArray*">types</arg>
<sel>fromWindow:</sel>
<arg type="NSWindow*">win</arg>
<desc>
Remove (decrement count by 1) each drag type from
those registered for the window. If this results in a
change to the <var>types</var> registered in the
counted set, return <code>YES</code>, otherwise
return <code>NO</code>. If given 'nil' as the array
of <var>types</var>, remove ALL. Subclasses should
override this method, call 'super' and take
appropriate action if the method returns 'YES'.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSSize">
<sel>resolutionForScreen:</sel>
<arg type="int">screen</arg>
<desc>
Retuns the resolution, in points, for the indicated
<var>screen</var> of the display.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSArray*">
<sel>screenList</sel>
<desc>
Returns an array of NSNumbers, where each number
describes a screen that is available on this
display.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void*">
<sel>serverDevice</sel>
<desc>
Returns a display dependant pointer that describes
the internal connection to the display. On X-Windows,
for example, this is a pointer to the
<code>Display</code> variable.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="BOOL">
<sel>slideImage:</sel>
<arg type="NSImage*">image</arg>
<sel>from:</sel>
<arg type="NSPoint">from</arg>
<sel>to:</sel>
<arg type="NSPoint">to</arg>
<desc>
<em>Description forthcoming.</em>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSWindowDepth">
<sel>windowDepthForScreen:</sel>
<arg type="int">screen</arg>
<desc>
Returns the default depth of windows that are
created on <var>screen</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void*">
<sel>windowDevice:</sel>
<arg type="int">win</arg>
<desc>
Returns a display dependant pointer that describes
the internal window representation for <var>win</var>.
On X-Windows, for example, this is a pointer to the
<code>Window</code> variable.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</class>
</chapter>
<chapter>
<heading>
Software documentation for the
GSDisplayServer(EventOps) category
</heading>
<category name="EventOps" class="GSDisplayServer">
<declared>AppKit/GSDisplayServer.h</declared>
<desc>
<em>Description forthcoming.</em>
</desc>
<method type="void">
<sel>discardEventsMatchingMask:</sel>
<arg type="unsigned">mask</arg>
<sel>beforeEvent:</sel>
<arg type="NSEvent*">limit</arg>
<desc>
<em>Description forthcoming.</em>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSEvent*">
<sel>getEventMatchingMask:</sel>
<arg type="unsigned">mask</arg>
<sel>beforeDate:</sel>
<arg type="NSDate*">limit</arg>
<sel>inMode:</sel>
<arg type="NSString*">mode</arg>
<sel>dequeue:</sel>
<arg type="BOOL">flag</arg>
<desc>
<em>Description forthcoming.</em>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>postEvent:</sel>
<arg type="NSEvent*">anEvent</arg>
<sel>atStart:</sel>
<arg type="BOOL">flag</arg>
<desc>
<em>Description forthcoming.</em>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</category>
</chapter>
<chapter>
<heading>
Software documentation for the
GSDisplayServer(WindowOps) category
</heading>
<category name="WindowOps" class="GSDisplayServer">
<declared>AppKit/GSDisplayServer.h</declared>
<desc>
<em>Description forthcoming.</em>
</desc>
<method type="void">
<sel>_setWindowOwnedByServer:</sel>
<arg type="int">win</arg>
<desc>
Tells the receiver that it owns the window described
by <var>win</var>. 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
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="BOOL">
<sel>appOwnsMiniwindow</sel>
<desc>
Returns <code>YES</code> 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
<code>NO</code>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="BOOL">
<sel>capturemouse:</sel>
<arg type="int">win</arg>
<desc>
Grabs the pointer device so that all future mouse
events will be directed only to the window
<var>win</var>. If successful, the return value is
<code>YES</code> and this message must be balanced
by a
<ref type="method" id="-releasemouse">
-releasemouse
</ref>
message.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>docedited:</sel>
<arg type="int">edited</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Sets the document <var>edited</var> flag for the
window
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="BOOL">
<sel>findwindow:</sel>
<arg type="NSPoint">loc</arg>
<sel>:</sel>
<arg type="int">op</arg>
<sel>:</sel>
<arg type="int">otherWin</arg>
<sel>:</sel>
<arg type="NSPoint*">floc</arg>
<sel>:</sel>
<arg type="int*">winFound</arg>
<desc>
<em>Description forthcoming.</em>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>flushwindowrect:</sel>
<arg type="NSRect">rect</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Causes buffered graphics to be flushed to the screen
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>hidecursor</sel>
<desc>
Hides the cursor
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>imagecursor:</sel>
<arg type="NSPoint">hotp</arg>
<sel>:</sel>
<arg type="int">w</arg>
<sel>:</sel>
<arg type="int">h</arg>
<sel>:</sel>
<arg type="int">colors</arg>
<sel>:</sel>
<arg type="const char*">image</arg>
<sel>:</sel>
<arg type="void**">cid</arg>
<desc>
Create a cursor from an <var>image</var>. Returns a
pointer to the internal device representation that
can be used later to make this cursor the current one
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>miniwindow:</sel>
<arg type="int">win</arg>
<desc>
Miniaturizes the window
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSPoint">
<sel>mouselocation</sel>
<desc>
Returns the current mouse location
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>movewindow:</sel>
<arg type="NSPoint">loc</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Moves the bottom left cornder of the window to
<var>loc</var>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>orderwindow:</sel>
<arg type="int">op</arg>
<sel>:</sel>
<arg type="int">otherWin</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Causes the window to be ordered onto or off the
screen depending on the value of <var>op</var>. The
window is ordered relative to <var>otherWin</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>placewindow:</sel>
<arg type="NSRect">frame</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Moves and resizes the window on the screen as
described by <var>frame</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>releasemouse</sel>
<desc>
Release a previous captured mouse from
<ref type="method" id="-capturemouse:">
-capturemouse:
</ref>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>setcursorcolor:</sel>
<arg type="NSColor*">fg</arg>
<sel>:</sel>
<arg type="NSColor*">bg</arg>
<sel>:</sel>
<arg type="void*">cid</arg>
<desc>
Set the cursor given by the <var>cid</var>
representation as being the current cursor.
The cursor has a foreground color <var>fg</var> and a
background color <var>bg</var>. To keep the
default color for the cursor, pass <code>nil</code>
for <var>fg</var> and <var>bg</var>.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>setinputfocus:</sel>
<arg type="int">win</arg>
<desc>
Forces focus to the window so that all key events
are sent to this window
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>setinputstate:</sel>
<arg type="int">state</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Sets the input <var>state</var> for the window given
by the GSWindowInputState constant. Instructs the window
manager that the specified window is 'key', 'main',
or just a normal window.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>setmaxsize:</sel>
<arg type="NSSize">size</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Set the maximum <var>size</var> of the window
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>setminsize:</sel>
<arg type="NSSize">size</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Set the minimum <var>size</var> of the window
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>setresizeincrements:</sel>
<arg type="NSSize">size</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Set the resize incremenet of the window
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>setwindowlevel:</sel>
<arg type="int">level</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Set the <var>level</var> of the window as in [NSWindow
-setLevel]
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>showcursor</sel>
<desc>
Show a previously hidden cursor
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>standardcursor:</sel>
<arg type="int">style</arg>
<sel>:</sel>
<arg type="void**">cid</arg>
<desc>
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
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>styleoffsets:</sel>
<arg type="float*">l</arg>
<sel>:</sel>
<arg type="float*">r</arg>
<sel>:</sel>
<arg type="float*">t</arg>
<sel>:</sel>
<arg type="float*">b</arg>
<sel>:</sel>
<arg type="int">style</arg>
<desc>
Returns the dimensions of the window that are
inside the window frame but are controlled by the
window manager. For instance, <var>t</var> gives the
height of the title bar for the window
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>stylewindow:</sel>
<arg type="int">style</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Sets the <var>style</var> of the window. See [NSWindow
-styleMask] for a description of the available
styles
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>termwindow:</sel>
<arg type="int">win</arg>
<desc>
Destroys the representation of the window and
frees and memory associated with it.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>titlewindow:</sel>
<arg type="NSString*">window_title</arg>
<sel>:</sel>
<arg type="int">win</arg>
<desc>
Sets the window title
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="int">
<sel>window:</sel>
<arg type="NSRect">frame</arg>
<sel>:</sel>
<arg type="NSBackingStoreType">type</arg>
<sel>:</sel>
<arg type="unsigned int">style</arg>
<desc>
Creates a window whose location and size is
described by <var>frame</var> and whose backing
store is described by <var>type</var>. This window is
not mapped to the screen by this call
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>windowbacking:</sel>
<arg type="NSBackingStoreType">type</arg>
<desc>
Changes window's the backing store to
<var>type</var>
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSRect">
<sel>windowbounds:</sel>
<arg type="int">win</arg>
<desc>
Retuns the frame of the window on the screen
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="int">
<sel>windowdepth:</sel>
<arg type="int">win</arg>
<desc>
Returns the depth of the window
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="void">
<sel>windowdevice:</sel>
<arg type="int">win</arg>
<desc>
Sets the window drawable for the current
NSGraphicsContext, typically by calling
[NSGraphicsContext
-DPSsetgcdrawable::::], although
depending on the concrete implmentation, more
information than this may need to be exchanged.
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="int">
<sel>windowlevel:</sel>
<arg type="int">win</arg>
<desc>
Returns the window level as in [NSWindow -level]
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<method type="NSArray*">
<sel>windowlist</sel>
<desc>
Returns the list of windows that the server
controls
</desc>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</method>
<standards>
<NotOpenStep /> <NotMacOS-X /> <GNUstep />
</standards>
</category>
</chapter>
</body>
</gsdoc>