PreviousUpNext

15.4.1590  src/lib/x-kit/xclient/src/iccc/atom.pkg

## atom.pkg
#
# Atoms are short integer representations
# of strings maintained by the X server.
#
# The X Inter-Client Communication Convention
# (ICCC) defines a standard set of atoms; see:
#
#     src/lib/x-kit/xclient/src/iccc/standard-x11-atoms.pkg
#
# See also:
#
#     src/lib/x-kit/xclient/src/iccc/atom-imp-old.pkg

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


# This functionality gets exported as part of the selection
# stuff in
#
#     src/lib/x-kit/xclient/xclient.pkg
#
# This package also gets used in:
#
#     src/lib/x-kit/xclient/src/wire/value-to-wire.pkg
#     src/lib/x-kit/xclient/src/wire/wire-to-value.pkg
#     src/lib/x-kit/xclient/src/iccc/standard-x11-atoms.pkg
#     src/lib/x-kit/xclient/src/iccc/atom-ximp.pkg
#     src/lib/x-kit/xclient/src/iccc/atom-table.pkg
#     src/lib/x-kit/xclient/src/window/window.pkg
#     src/lib/x-kit/xclient/src/window/selection-imp-old.pkg
#     src/lib/x-kit/xclient/src/window/window-property-imp-old.pkg


stipulate
    include package   threadkit;                                # threadkit             is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    #
    package w2v =  wire_to_value;                               # wire_to_value         is from   src/lib/x-kit/xclient/src/wire/wire-to-value.pkg
    package v2w =  value_to_wire;                               # value_to_wire         is from   src/lib/x-kit/xclient/src/wire/value-to-wire.pkg
    #
    package sn  =  xsession_junk;                               # xsession_junk         is from   src/lib/x-kit/xclient/src/window/xsession-junk.pkg
herein

    package atom: (weak)  api {
        #
        make_atom:       sn::Xsession -> String -> xtypes::Atom;
        find_atom:       sn::Xsession -> String -> Null_Or( xtypes::Atom );
        atom_to_string:  sn::Xsession -> xtypes::Atom -> String;

    } {

        fun intern  (x: sn::Xsession)  arg
            =
            w2v::decode_intern_atom_reply
                (
                block_until_mailop_fires
#               ========================                        XXX SUCKO FIXME
                    (
                        x.windowsystem_to_xserver.xclient_to_sequencer.send_xrequest_and_read_reply
                            (v2w::encode_intern_atom  arg)
                    )
                );

        fun make_atom  xsession  name
            =
            intern
                xsession
                { name, only_if_exists => FALSE };

        fun find_atom  xsession  name
            =
            case (intern  xsession  { name, only_if_exists => TRUE } )
                #
                (xtypes::XATOM  0u0) =>  NULL;
                xa                   =>  THE xa;
            esac;

        fun atom_to_string  (x: sn::Xsession)  atom
            =
            w2v::decode_get_atom_name_reply
                (
                block_until_mailop_fires
#               ========================                        XXX SUCKO FIXME
                    (
                        x.windowsystem_to_xserver.xclient_to_sequencer.send_xrequest_and_read_reply
                            (v2w::encode_get_atom_name { atom } )
                    )
                );
    };                                          # package xatom
end;

## 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