## client-to-selection.pkg
#
# Requests from app/widget code to the atom-ximp.
# Compiled by:
#
src/lib/x-kit/xclient/xclient-internals.sublibstipulate
include package threadkit; # threadkit is from
src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg #
package xt = xtypes; # xtypes is from
src/lib/x-kit/xclient/src/wire/xtypes.pkg package ts = xserver_timestamp; # xserver_timestamp is from
src/lib/x-kit/xclient/src/wire/xserver-timestamp.pkgherein
# This port is implemented in:
#
#
src/lib/x-kit/xclient/src/window/selection-ximp.pkg #
package client_to_selection {
#
# The request for a selection
# that gets sent to the owner:
#
Selection_Plea = { target: xt::Atom,
timestamp: Null_Or( ts::Xserver_Timestamp ),
reply: Null_Or( xt::Property_Value ) -> Void
};
Selection_Handle = { selection: xt::Atom, # Client record representing a selection held:
timestamp: ts::Xserver_Timestamp,
release': Mailop( Void ), # This mailop will fire when the selection is lost (SelectionClear x-event).
release: Void -> Void
};
Client_To_Selection = { acquire_selection
:
(xt::Window_Id, xt::Atom, ts::Xserver_Timestamp, Selection_Plea -> Void)
->
Null_Or( Selection_Handle ),
request_selection
:
{ window: xt::Window_Id, # Requesting window.
selection: xt::Atom, # Requested selection.
target: xt::Atom, # Requested target type.
property: xt::Atom,
timestamp: ts::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.
};
}; # package client_to_selection
end;