PreviousUpNext

15.4.1641  src/lib/x-kit/xclient/src/window/ro-pixmap.pkg

## ro-pixmap.pkg
#
# See also:
#     src/lib/x-kit/xclient/src/window/window-old.pkg
#     src/lib/x-kit/xclient/src/window/cs-pixmap-old.pkg
#     src/lib/x-kit/xclient/src/window/rw-pixmap-old.pkg

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





###                     "My method to overcome a difficulty is to go round it."
###
###                                               -- George Polya


stipulate
    package cw  =  cs_pixmap;                                   # cs_pixmap             is from   src/lib/x-kit/xclient/src/window/cs-pixmap.pkg
    package dr  =  draw;                                        # draw                  is from   src/lib/x-kit/xclient/src/window/draw.pkg
    package dt  =  draw_types;                                  # draw_types            is from   src/lib/x-kit/xclient/src/window/draw-types.pkg
    package g2d =  geometry2d;                                  # geometry2d            is from   src/lib/std/2d/geometry2d.pkg
    package wp  =  rw_pixmap;                                   # rw_pixmap             is from   src/lib/x-kit/xclient/src/window/rw-pixmap.pkg
    package sn  =  xsession_junk;                               # xsession_junk         is from   src/lib/x-kit/xclient/src/window/xsession-junk.pkg
    package pn  =  pen;                                         # pen                   is from   src/lib/x-kit/xclient/src/window/pen.pkg
herein


    package   ro_pixmap
    : (weak)  Ro_Pixmap                                         # Ro_Pixmap             is from   src/lib/x-kit/xclient/src/window/ro-pixmap.api
    {
        Ro_Pixmap == sn::Ro_Pixmap;

        fun make_readonly_pixmap_from_clientside_pixmap screen im
            =
            sn::RO_PIXMAP (cw::make_readwrite_pixmap_from_clientside_pixmap screen im);


        fun make_readonly_pixmap_from_ascii screen data
            =
            sn::RO_PIXMAP (cw::make_readwrite_pixmap_from_ascii_data screen data);


        fun make_readonly_pixmap_from_readwrite_pixmap (pm as { screen, size, per_depth_imps, ... }: sn::Rw_Pixmap)
            =
            {   per_depth_imps
                    ->
                    { depth, ... }:     sn::Per_Depth_Imps;

                new_pixmap
                    =
                    wp::make_readwrite_pixmap
                        screen
                        (size, depth);

                dr::pixel_blt
                    #
                    (dt::drawable_of_rw_pixmap  new_pixmap)
                    #
                    pn::default_pen
                    #
                    { from     =>  dt::FROM_RW_PIXMAP pm,
                      from_box =>  g2d::box::make (g2d::point::zero, size),
                      to_pos   =>  g2d::point::zero
                    };

                sn::RO_PIXMAP new_pixmap;
            };
    };
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