Files
cdesktop/cde/doc/C/guides/man/man4/Display.sgm

156 lines
5.2 KiB
Plaintext

<!-- $XConsortium: Display.sgm /main/7 1996/09/08 20:13:45 rws $ -->
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
<!-- (c) Copyright 1995 International Business Machines Corp. -->
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
<!-- (c) Copyright 1995 Novell, Inc. -->
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
<!-- (c) Copyright 1995 Hitachi. -->
<![ %CDE.C.CDE; [<RefEntry Id="CDEMX.XCDI.MAN283.rsml.1">]]>
<![ %CDE.C.XO; [<RefEntry Id="XCDI.MAN283.rsml.1">]]>
<RefMeta>
<RefEntryTitle>Display</RefEntryTitle>
<ManVolNum>special file</ManVolNum>
</RefMeta>
<RefNameDiv>
<RefName><Symbol Role="Message">Display</Symbol></RefName>
<RefPurpose>display a document
</RefPurpose>
</RefNameDiv>
<!-- $XConsortium: Display.sgm /main/7 1996/09/08 20:13:45 rws $-->
<!-- CDE Common Source Format, Version 1.0.0-->
<!-- (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company-->
<!-- (c) Copyright 1993, 1994, 1995 International Business Machines Corp.-->
<!-- (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.-->
<!-- (c) Copyright 1993, 1994, 1995 Novell, Inc.-->
<RefSynopsisDiv>
<Synopsis>[<Symbol Role="Variable">file</Symbol>] Display(in <Emphasis>mediaType contents</Emphasis>
[in title <Emphasis>docName</Emphasis>]);
</Synopsis>
</RefSynopsisDiv>
<RefSect1>
<Title>DESCRIPTION</Title>
<Para>The
<Symbol Role="Message">Display</Symbol> request causes the handler to display (present or manifest)
a document to the user.
For example, an audio manipulation utility would be said to
``display'' audio documents when it plays them.
</Para>
<Para>The handler must decide issues such as:
</Para>
<ItemizedList>
<ListItem>
<Para>When the display operation can be deemed completed
</Para>
</ListItem>
<ListItem>
<Para>What user gesture signals the completion of the display
</Para>
</ListItem>
<ListItem>
<Para>What the handling tool should do with itself after replying
</Para>
</ListItem>
</ItemizedList>
<Para>The
<Emphasis>contents</Emphasis> argument
is the contents of the document.
If this argument is unset
(in other words, has a value of
<Literal>(char *)0</Literal>), then the contents of the document are in
the file named in the message's
<Symbol Role="Variable">file</Symbol> attribute.
The data type
(<Emphasis>mediaType</Emphasis>) of the
<Emphasis>contents</Emphasis> argument should be
<Literal>string</Literal>, unless nulls are valid in the given media type,
in which case the data type must be
<Literal>bytes</Literal>.</Para>
<Para>The
<Emphasis>docName</Emphasis> argument contains the name of the document.
If the
<Emphasis>docName</Emphasis> argument is absent and the
<Symbol Role="Variable">file</Symbol> attribute is set,
the file name is considered to be the title of the document.
This string would be suitable for display in a window title bar, for example.
</Para>
</RefSect1>
<RefSect1>
<Title>APPLICATION USAGE</Title>
<Para>The
&cdeman.ttmedia.ptype.declare; function can be used to register for,
and help process, this message.
</Para>
<Para>This message can be sent with the
&cdeman.ttmedia.load; function.
</Para>
<Para>When the document to be displayed
is read-only or unlikely to be modified
the
<Symbol Role="Message">Display</Symbol> message is frequently used instead of the
<Symbol Role="Message">Edit</Symbol> message.
</Para>
</RefSect1>
<RefSect1>
<Title>EXAMPLES</Title>
<Para>To display a PostScript document, the application can send a
<Symbol Role="Message">Display</Symbol> request with a first argument whose vtype is
<Literal>PostScript</Literal>, and whose value is a vector of bytes such as:
</Para>
<InformalExample Remap="indent">
<ProgramListing>%!&bsol;n/inch {72 mul} def...
</ProgramListing>
</InformalExample>
<Para>The
<Literal>&bsol;n</Literal> in the example represents the newline character.
The notation is the same as in the &str-Z3;.
</Para>
<Para>To display a PostScript document contained in a file,
the application can send a
<Symbol Role="Message">Display</Symbol> request with the
<Symbol Role="Variable">file</Symbol> attribute set to that file
and with an unset first argument whose vtype is
<Literal>PostScript</Literal>.</Para>
</RefSect1>
<RefSect1>
<Title>ERRORS</Title>
<Para>The ToolTalk service may return one of the following errors
in processing the
<Symbol Role="Message">Display</Symbol> request:
</Para>
<VariableList>
<VarListEntry>
<Term>TT_DESKTOP_ENOENT</Term>
<ListItem>
<Para>The file that was alleged to contain the document does not exist.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TT_DESKTOP_ENODATA</Term>
<ListItem>
<Para>The in-mode
<Emphasis>contents</Emphasis> argument had no value and the
<Symbol Role="Variable">file</Symbol> attribute
of the message was not set.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TT_MEDIA_ERR_FORMAT</Term>
<ListItem>
<Para>The document is not a valid instance of the media type.
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</RefSect1>
<RefSect1>
<Title>SEE ALSO</Title>
<Para>&cdeman.ttmedia.ptype.declare;, &cdeman.ttmedia.load;; <Emphasis>Intro</Emphasis>, <Symbol Role="Message">Deposit</Symbol>, <Symbol Role="Message">Edit</Symbol>, <Symbol Role="Message">Status</Symbol> requests.
</Para>
</RefSect1>
</RefEntry>
<!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:18:47-->