## xserver-ximp.api
#
# For the big picture see the imp dataflow diagrams in
#
#
src/lib/x-kit/xclient/src/window/xclient-ximps.pkg#
# Use protocol is:
#
# Next up is parameter support for:
# error_sink
# to_x_sink
# from_x_mailqueue
#
# { (make_run_gun ()) -> { run_gun', fire_run_gun };
# (make_end_gun ()) -> { end_gun', fire_end_gun };
#
# egg = sx::make_xserver_ximp_egg (xdisplay, drawable, []);
# (egg ()) -> = (exports, egg');
# sx = exports.xserver; # The clientport represents the imp for most purposes.
#
# ... # Create other app imps.
#
# egg' ({ ... }, run_gun', end_gun' ); # Wire imp to other imps.
# # All imps will start when run_gun' fires.
#
# ... # Wire up other app imps similarly.
#
# fire_run_gun (); # Start all app imps running.
#
# sx.send_xrequest(...); # Many calls like this over lifetime of imp.
# ... # Similar calls to other app imps.
#
# fire_end_gun (); # Shut the imp down cleanly.
# };
# 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 w2x = windowsystem_to_xserver; # windowsystem_to_xserver is from
src/lib/x-kit/xclient/src/window/windowsystem-to-xserver.pkg package x2s = xclient_to_sequencer; # xclient_to_sequencer is from
src/lib/x-kit/xclient/src/wire/xclient-to-sequencer.pkg package wme = window_map_event_sink; # window_map_event_sink is from
src/lib/x-kit/xclient/src/window/window-map-event-sink.pkg package xt = xtypes; # xtypes is from
src/lib/x-kit/xclient/src/wire/xtypes.pkg package xwp = windowsystem_to_xevent_router; # windowsystem_to_xevent_router is from
src/lib/x-kit/xclient/src/window/windowsystem-to-xevent-router.pkg package dy = display; # display is from
src/lib/x-kit/xclient/src/wire/display.pkgherein
# This api is implemented in:
#
#
src/lib/x-kit/xclient/src/window/xserver-ximp.pkg #
api Xserver_Ximp
{
Exports = { # Ports we export for use by other imps.
window_map_event_sink: wme::Window_Map_Event_Sink, # Tells us when our window is un/mapped (hidden/revealed).
windowsystem_to_xserver: w2x::Windowsystem_To_Xserver # Draw (etc) commands from widget/application code.
};
Imports = { # Ports we use which are exported by other imps.
windowsystem_to_xevent_router: xwp::Windowsystem_To_Xevent_Router, # Directs X mouseclicks etc to right hostwindow.
xclient_to_sequencer: x2s::Xclient_To_Sequencer # All drawing commands go to Xserver via sequencer then outbuf.
};
Option = MICROTHREAD_NAME String; #
Xserver_Egg = Void -> (Exports, (Imports, Run_Gun, End_Gun) -> Void);
make_xserver_egg
:
(
dy::Xdisplay,
xt::Drawable_Id,
List(Option)
)
-> Xserver_Egg; #
}; # api Xserver_Ximp
end;