## selection-imp-old.api
#
# See also:
#
src/lib/x-kit/xclient/src/window/selection-old.api# Compiled by:
#
src/lib/x-kit/xclient/xclient-internals.sublib# This is the lowest-level interface to the ICCCM selection protocol.
# There is one selection imp per display connection.
stipulate
include package threadkit; # threadkit is from
src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg #
package xet = xevent_types; # xevent_types is from
src/lib/x-kit/xclient/src/wire/xevent-types.pkg package xt = xtypes; # xtypes is from
src/lib/x-kit/xclient/src/wire/xtypes.pkg package dy = display_old; # display_old is from
src/lib/x-kit/xclient/src/wire/display-old.pkg package ts = xserver_timestamp;
herein
# This api is implemented in:
#
src/lib/x-kit/xclient/src/window/selection-imp-old.pkg api Selection_Imp_Old {
#
Selection_Imp;
Selection_Handle;
Atom = xt::Atom;
Xserver_Timestamp = ts::Xserver_Timestamp;
make_selection_imp
:
dy::Xdisplay
->
( Mailslot( xet::x::Event ),
Selection_Imp
);
# Selection owner operations:
#
acquire_selection
:
Selection_Imp
->
(xt::Window_Id, Atom, Xserver_Timestamp)
->
Null_Or( Selection_Handle );
selection_of: Selection_Handle -> Atom;
timestamp_of: Selection_Handle -> Xserver_Timestamp;
plea_mailop
:
Selection_Handle
->
Mailop
{
target: Atom,
timestamp: Null_Or( Xserver_Timestamp ),
reply: Null_Or( xt::Property_Value ) -> Void
};
#
# This mailop is enabled once for each request for the selection.
# The target field is the requested target type;
# The time field is the server-time of the gesture that caused the request;
# The reply field is a function for sending the reply.
# Strictly speaking this violates the ICCC specification,
# but applications may choose to accept it.
release_mailop
:
Selection_Handle
->
Mailop( Void );
#
# This mailop becomes enabled when the selection is lost; either by
# the owner releasing it, or by some other client acquiring ownership.
release_selection: Selection_Handle -> Void;
#
# Release ownership of the selection.
# Selection requestor operations:
#
request_selection
:
Selection_Imp
->
{ window: xt::Window_Id, # Requesting window.
selection: Atom, # Requested selection.
target: Atom, # Requested target type.
property: Atom,
timestamp: Xserver_Timestamp # Server-timestamp of the gesture causing the request.
}
->
Mailop( Null_Or( xt::Property_Value ) );
# Request the value of the selection.
#
# This returns a mailop that will become
# enabled when the reply is received.
};
end; # stipulate
## COPYRIGHT (c) 1994 by AT&T Bell Laboratories. See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.