PreviousUpNext

15.3.792  src/lib/x-kit/xclient/src/window/xsocket-to-hostwindow-router-old.api

## xsocket-to-hostwindow-router-old.api
#
# API for functionality which reads Xevents from
#
#     src/lib/x-kit/xclient/src/wire/xsocket-old.pkg

# (specifically, decode_xpackets_imp) and routes them
# to the appropriate top-level window.
# From there they get routed down the widget tree:
#
#     src/lib/x-kit/xclient/src/window/hostwindow-to-widget-router-old.api

# Compiled by:
#     src/lib/x-kit/xclient/xclient-internals.sublib



stipulate
    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 g2d =  geometry2d;                                          # geometry2d            is from   src/lib/std/2d/geometry2d.pkg
    package dy  =  display_old;                                         # display_old           is from   src/lib/x-kit/xclient/src/wire/display-old.pkg
    package ki  =  keymap_imp_old;                                      # keymap_imp_old        is from   src/lib/x-kit/xclient/src/window/keymap-imp-old.pkg
herein

    # This api is implemented in:
    #
    #     src/lib/x-kit/xclient/src/window/xsocket-to-hostwindow-router-old.pkg

    api Xsocket_To_Hostwindow_Router_Old {
        #
        Xsocket_To_Hostwindow_Router;

        Envelope_Route
          = ENVELOPE_ROUTE_END  xt::Window_Id
          | ENVELOPE_ROUTE     (xt::Window_Id, Envelope_Route)
          ;
                        # XXX BUGGO FIXME Envelope_Route should be defined elswhere, with Envelope.
                        # Current Envelope is defined in src/lib/x-kit/xclient/src/window/widget-cable-old.pkg

        make_xsocket_to_hostwindow_router
            :
            { xdisplay:       dy::Xdisplay,
              keymap_imp:     ki::Keymap_Imp,
              #
              to_window_property_imp_slot:  Mailslot( xevent_types::x::Event ),
              to_selection_imp_slot:        Mailslot( xevent_types::x::Event )
            }
            ->
            Xsocket_To_Hostwindow_Router;

        # Note new toplevel window and return the event slot
        # through which we will feed X events to that window:
        #
        note_new_hostwindow
            :
            ( Xsocket_To_Hostwindow_Router,
              xt::Window_Id,
              g2d::Window_Site  
            )
            ->
            Mailop( (Envelope_Route, xevent_types::x::Event) );

        # Get size of window plus position
        # relative to parent:
        #
        get_window_site
            :
            ( Xsocket_To_Hostwindow_Router,
              xt::Window_Id
            )
            ->
            g2d::Box;


        # Infrastructure -- see comments in src/lib/x-kit/xclient/src/window/xsocket-to-hostwindow-router-old.pkg
        #
        note_window's_''seen_first_expose''_oneshot
            :
            ( Xsocket_To_Hostwindow_Router,
              xt::Window_Id,
              Oneshot_Maildrop(Void)
            )
            ->
            Void;

        # This function makes the above oneshot
        # available to clients with access to
        # the Window but not the Widget.  Clients
        # with access to the Widget should use the
        #
        #     widget::seen_first_redraw_oneshot_of
        #
        # call because it is guaranteed to return
        # the required oneshot;  the below call may
        # return NULL, in which case the client thread
        # will have to sleep a bit and then retry:
        #
        get_''seen_first_expose''_oneshot_of
            :
            ( Xsocket_To_Hostwindow_Router,
              xt::Window_Id
            )
            ->
            Null_Or(Oneshot_Maildrop(Void));

        
        # Application threads can wait on the oneshot
        # returned by this call; when it fires they
        # can be confident that the GUI windows exist
        # and the widget threads have been created and
        # in general the widgettree is go.
        #
        # Currently this oneshot it set when the first
        # EXPOSE xevent is received from the X server,
        # but that is internal implementation, not
        # supported external semantics:
        #
        get_''gui_startup_complete''_oneshot_of
            :
            Xsocket_To_Hostwindow_Router
            ->
            Oneshot_Maildrop(Void);

    };
end;                                            # stipulate



## COPYRIGHT (c) 1990, 1991 by John H. Reppy.  See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext