PreviousUpNext

15.4.1469  src/lib/x-kit/widget/lib/run-in-x-window.pkg

## run-in-x-window.pkg
#

# Compiled by:
#     src/lib/x-kit/widget/xkit-widget.sublib





stipulate
    include package   threadkit;                                # threadkit                                     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    #
    #
    package qk = quark;                                         # quark                                         is from   src/lib/x-kit/style/quark.pkg
    package xc =  xclient;                                      # xclient                                       is from   src/lib/x-kit/xclient/xclient.pkg
    package un  =  unt;                                         # unt                                           is from   src/lib/std/unt.pkg
    package v1u =  vector_of_one_byte_unts;                     # vector_of_one_byte_unts                       is from   src/lib/std/src/vector-of-one-byte-unts.pkg
#   package v2w =  value_to_wire;                               # value_to_wire                                 is from   src/lib/x-kit/xclient/src/wire/value-to-wire.pkg
#   package w2v =  wire_to_value;                               # wire_to_value                                 is from   src/lib/x-kit/xclient/src/wire/wire-to-value.pkg
    package g2d =  geometry2d;                                  # geometry2d                                    is from   src/lib/std/2d/geometry2d.pkg
    package xtr =  xlogger;                                     # xlogger                                       is from   src/lib/x-kit/xclient/src/stuff/xlogger.pkg
    package wnx =  winix__premicrothread;                       # winix__premicrothread                         is from   src/lib/std/winix--premicrothread.pkg
    package v8s =  vector_slice_of_one_byte_unts;               # vector_slice_of_one_byte_unts                 is from   src/lib/std/src/vector-slice-of-one-byte-unts.pkg
    package w8v =  vector_of_one_byte_unts;                     # vector_of_one_byte_unts                       is from   src/lib/std/src/vector-of-one-byte-unts.pkg

    package mop =  mailop;                                      # mailop                                        is from   src/lib/src/lib/thread-kit/src/core-thread-kit/mailop.pkg
    package sok =  socket__premicrothread;                      # socket__premicrothread                        is from   src/lib/std/socket--premicrothread.pkg

    package dns =  dns_host_lookup;                             # dns_host_lookup                               is from   src/lib/std/src/socket/dns-host-lookup.pkg

#   package r2k =  xevent_router_to_keymap;                     # xevent_router_to_keymap                       is from   src/lib/x-kit/xclient/src/window/xevent-router-to-keymap.pkg
    package pc  =  pen_cache;                                   # pen_cache                                     is from   src/lib/x-kit/xclient/src/window/pen-cache.pkg

    package sj  =  socket_junk;                                 # socket_junk                                   is from   src/lib/internet/socket-junk.pkg
    package sci =  socket_closer_imp;                           # socket_closer_imp                             is from   src/lib/x-kit/xclient/src/wire/socket-closer-imp.pkg

#   package op  =  xsequencer_to_outbuf;                        # xsequencer_to_outbuf                          is from   src/lib/x-kit/xclient/src/wire/xsequencer-to-outbuf.pkg
#   package x2s =  xclient_to_sequencer;                        # xclient_to_sequencer                          is from   src/lib/x-kit/xclient/src/wire/xclient-to-sequencer.pkg
#   package xes =  xevent_sink;                                 # xevent_sink                                   is from   src/lib/x-kit/xclient/src/wire/xevent-sink.pkg
#   package xew =  xerror_well;                                 # xerror_well                                   is from   src/lib/x-kit/xclient/src/wire/xerror-well.pkg
    package xt  =  xtypes;                                      # xtypes                                        is from   src/lib/x-kit/xclient/src/wire/xtypes.pkg
#   package xet =  xevent_types;                                # xevent_types                                  is from   src/lib/x-kit/xclient/src/wire/xevent-types.pkg

    package rpx =  ro_pixmap_ximp;                              # ro_pixmap_ximp                                is from   src/lib/x-kit/widget/lib/ro-pixmap-ximp.pkg
    package imx =  image_ximp;                                  # image_ximp                                    is from   src/lib/x-kit/widget/lib/image-ximp.pkg
    package shx =  shade_ximp;                                  # shade _ximp                                   is from   src/lib/x-kit/widget/lib/shade-ximp.pkg

    package fx  =  font_index;                                  # font_index                                    is from   src/lib/x-kit/xclient/src/window/font-index.pkg

    package exx =  xserver_ximp;                                # xserver_ximp                                  is from   src/lib/x-kit/xclient/src/window/xserver-ximp.pkg
#   package w2x =  windowsystem_to_xserver;                     # windowsystem_to_xserver                       is from   src/lib/x-kit/xclient/src/window/windowsystem-to-xserver.pkg

#   not visible here.

#   package ox  =  outbuf_ximp;                                 # outbuf_ximp                                   is from   src/lib/x-kit/xclient/src/wire/outbuf-ximp.pkg
#   package sx  =  xsequencer_ximp;                             # xsequencer_ximp                               is from   src/lib/x-kit/xclient/src/wire/xsequencer-ximp.pkg
#   package dxx =  decode_xpackets_ximp;                        # decode_xpackets_ximp                          is from   src/lib/x-kit/xclient/src/wire/decode-xpackets-ximp.pkg
    package dy  =  display;                                     # display                                       is from   src/lib/x-kit/xclient/src/wire/display.pkg
#   package cxa =  crack_xserver_address;                       # crack_xserver_address                         is from   src/lib/x-kit/xclient/src/wire/crack-xserver-address.pkg
    package uds =  unix_domain_socket__premicrothread;          # unix_domain_socket__premicrothread            is from   src/lib/std/src/socket/unix-domain-socket--premicrothread.pkg
    package is  =  internet_socket__premicrothread;             # internet_socket__premicrothread               is from   src/lib/std/src/socket/internet-socket--premicrothread.pkg

#   package sox =  xsocket_ximps;                               # xsocket_ximps                                 is from   src/lib/x-kit/xclient/src/wire/xsocket-ximps.pkg
#   package sex =  xsession_ximps;                              # xsession_ximps                                is from   src/lib/x-kit/xclient/src/window/xsession-ximps.pkg
    package clx =  xclient_ximps;                               # xclient_ximps                                 is from   src/lib/x-kit/xclient/src/window/xclient-ximps.pkg

    package aut =  authentication;                              # authentication                                is from   src/lib/x-kit/xclient/src/stuff/authentication.pkg
    package ax  =  atom_ximp;                                   # atom_ximp                                     is from   src/lib/x-kit/xclient/src/iccc/atom-ximp.pkg

    package wpx =  window_watcher_ximp;                         # window_watcher_ximp                           is from   src/lib/x-kit/xclient/src/window/window-watcher-ximp.pkg
    package sel =  selection_ximp;                              # selection_ximp                                is from   src/lib/x-kit/xclient/src/window/selection-ximp.pkg
    package sep =  client_to_selection;                         # client_to_selection                           is from   src/lib/x-kit/xclient/src/window/client-to-selection.pkg
    package sl  =  selection;                                   # selection                                     is from   src/lib/x-kit/xclient/src/window/selection.pkg

    package xj  =  xsession_junk;                               # xsession_junk                                 is from   src/lib/x-kit/xclient/src/window/xsession-junk.pkg
    package dt  =  draw_types;                                  # draw_types                                    is from   src/lib/x-kit/xclient/src/window/draw-types.pkg

    package csp =  cs_pixmap;                                   # cs_pixmap                                     is from   src/lib/x-kit/xclient/src/window/cs-pixmap.pkg
    package rop =  ro_pixmap;                                   # ro_pixmap                                     is from   src/lib/x-kit/xclient/src/window/ro-pixmap.pkg
    package rwp =  rw_pixmap;                                   # rw_pixmap                                     is from   src/lib/x-kit/xclient/src/window/rw-pixmap.pkg
    package pn  =  pen;                                         # pen                                           is from   src/lib/x-kit/xclient/src/window/pen.pkg
    package drw =  draw;                                        # draw                                          is from   src/lib/x-kit/xclient/src/window/draw.pkg

    package wdw =  window;                                      # window                                        is from   src/lib/x-kit/xclient/src/window/window.pkg
    package atm =  atom;                                        # atom                                          is from   src/lib/x-kit/xclient/src/iccc/atom.pkg
    package csr =  cursors;                                     # cursors                                       is from   src/lib/x-kit/xclient/src/window/cursors.pkg
    package ic  =  iccc_property;                               # iccc_property                                 is from   src/lib/x-kit/xclient/src/iccc/iccc-property.pkg
    package ewi =  xevent_to_widget_ximp;                       # xevent_to_widget_ximp                         is from   src/lib/x-kit/xclient/src/window/xevent-to-widget-ximp.pkg
    package wa  =  widget_attribute;                            # widget_attribute                              is from   src/lib/x-kit/widget/lib/widget-attribute.pkg
    package wc  =  widget_cable;                                # widget_cable                                  is from   src/lib/x-kit/xclient/src/window/widget-cable.pkg
    package hw  =  hash_window;                                 # hash_window                                   is from   src/lib/x-kit/xclient/src/window/hash-window.pkg
    package wp  =  window_property;                             # window_property                               is from   src/lib/x-kit/xclient/src/iccc/window-property.pkg
    package ws  =  widget_style;                                # widget_style                                  is from   src/lib/x-kit/widget/lib/widget-style.pkg
    package wmh =  window_manager_hint;                         # window_manager_hint                           is from   src/lib/x-kit/xclient/src/iccc/window-manager-hint.pkg
    package rw  =  root_window;                                 # root_window                                   is from   src/lib/x-kit/widget/lib/root-window.pkg

    Dummy =  xj::Xsession;                                      # Temporary kludge to force xsession-junk.pkg  to compile.
#   Dummo =  dt::Window;
    Dumma == csp::Cs_Pixmap;
    Dummb == rop::Ro_Pixmap;
    dummc  = rwp::BAD_PIXMAP_PARAMETER;
    dummd  = pn::BAD_PEN_TRAIT;
    dumme  = drw::BAD_DRAW_PARAMETER;
    dummf  = wdw::BAD_WINDOW_SITE;
    dummg  = atm::make_atom;
    Dummh == csr::Standard_Xcursor;
    dummi  =  ic::make_atom_property;
    dummj  = ewi::foo;
    dummk  =  wc::make_widget_cable;
    dumml  =  hw::make_map;
    Dummm == wmh::Window_Manager_Size_Hint;
    Dummn ==  wp::Raw_Data;
    dummo  =  sl::acquire_selection;
    dummp  =  wa::active;
    Dummq  =  ws::Style_Name;
    dummr  =  rw::make_root_window;
    dumms  =  sci::note_socket;

#    Dummy = dy::Xdisplay;                                      # Temporary kludge to force display.pkg  to compile.
#    Dummi = ax::Configstate;                                   # Temporary kludge to force atom-ximp.pkg to compile.
#    Dummu = sep::Selection_Handle;                             # Temporary kludge to force compilation.
#    Dummo = sep::Client_To_Selection;                          # Temporary kludge to force compilation.
herein

# As of 2014-02-05 this package is nowhere referenced.

    package   run_in_x_window
    :         Run_In_X_Window                                   # Run_In_X_Window                               is from   src/lib/x-kit/widget/lib/run-in-x-window.api
    {
        Dummy = Int;



###################
# XXX SUCKO FIXME
# This function is hugely redundant
# with make_root_window in   src/lib/x-kit/widget/lib/root-window.pkg
###################

        fun make_root_window                                                            # External entrypoint
                (display_or_null:  Null_Or( String ))                                   # Allow overriding of the DISPLAY environment variable setting.
            =
            {
printf "make_root_window()/AAA   -- run-in-x-window.pkg\n";

                (make_run_gun ()) ->   { run_gun', fire_run_gun };
                (make_end_gun ()) ->   { end_gun', fire_end_gun };



                (aut::get_xdisplay_string_and_xauthentication  display_or_null)         # This is from Reppy's oldworld make_root_window in src/lib/x-kit/widget/old/lib/run-in-x-window-old.pkg
                    ->
                    ( display_name:             String,                                 # Typically from $DISPLAY environment variable.
                      xauthentication:  Null_Or(xt::Xauthentication)                    # Typically from ~/.Xauthority
                    );
                                                                                        # Here canonical sequence calls make_root_window in src/lib/x-kit/widget/old/basic/root-window-old.pkg
                                                                                        # which                   calls open_xsession    in src/lib/x-kit/xclient/src/window/xsession-old.pkg
                                                                                        # which                   calls open_xdisplay    in src/lib/x-kit/xclient/src/wire/display-old.pkg

                root_window =   rw::make_root_window  { display_name,
                                                        xauthentication,
                                                        run_gun',
                                                        end_gun'
                                                      };





#               xlg::make_thread  "err_handler"  err_handler;

                                                                                        # Canonical sequence is now back in open_xsession in src/lib/x-kit/xclient/src/window/xsession-old.pkg

#               atom_imp   =   ai::make_atom_imp    xdisplay;
#               (wpi::make_window_property_imp (xdisplay, atom_imp)) -> (to_window_property_imp_slot, window_property_imp);
#               (si::make_selection_imp  xdisplay)                   -> (to_selection_imp_slot,  selection_imp);
#               xsocket_to_hostwindow_router = s2t::make_xsocket_to_hostwindow_router { ... }


#               fire_run_gun ();
#               fire_end_gun ();

                ();

            };


        # To run this interactively do
        # linxux% my
        # eval: load "src/lib/x-kit/xkit.lib";
        # eval: run_in_x_window::self_check ();
        #
        fun self_check ()
            =
            {
printf "self_check()/AAA   -- run-in-x-window.pkg\n";
                make_root_window NULL;
printf "self_check()/ZZZ   -- run-in-x-window.pkg\n";
            };


# We will want this eventually, but we do not yet have
# a newworld Root_Window:
#
#       fun run_in_x_window_old  do_it
#           =
#           {
#               {   do_it (make_root_window NULL);
#                   #
#                   winix__premicrothread::process::success;
#               }
#               except
#                   _ = winix__premicrothread::process::failure;
#
#               ();
#           };

    };                                                                                                                  # package run_in_x_window
end;




Comments and suggestions to: bugs@mythryl.org

PreviousUpNext