PreviousUpNext

15.3.761  src/lib/x-kit/xclient/src/window/draw-types-old.api

## draw-types-old.api
#
# Types of chunks that can be drawn on (or are pixel sources).

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

# This api is implemented in:
#
#     src/lib/x-kit/xclient/src/window/draw-types-old.pkg

stipulate
    package g2d=  geometry2d;                           # geometry2d            is from   src/lib/std/2d/geometry2d.pkg
    package xt =  xtypes;                               # xtypes                is from   src/lib/x-kit/xclient/src/wire/xtypes.pkg
    package sn =  xsession_old;                         # xsession_old          is from   src/lib/x-kit/xclient/src/window/xsession-old.pkg
    package di =  draw_imp_old;                         # draw_imp_old          is from   src/lib/x-kit/xclient/src/window/draw-imp-old.pkg
herein

    api Draw_Types_Old {

        # An on-screen rectangular array of pixels on the X server:
        #
        Window =  { window_id:                  xt::Window_Id,
                    #
                    screen:                             sn::Screen,
                    per_depth_imps:     sn::Per_Depth_Imps,
                    #
                    to_hostwindow_drawimp:              di::d::Draw_Op -> Void
                  };

        # An off-screen rectangular array of pixels on the X server:
        #
        Rw_Pixmap =   { pixmap_id:                      xt::Pixmap_Id,
                        screen:                         sn::Screen,
                        size:                           g2d::Size,
                        per_depth_imps: sn::Per_Depth_Imps
                      };

        # An off-screen read-only rectangular array of pixels on the X server: 
        #
        Ro_Pixmap
            =
            RO_PIXMAP  Rw_Pixmap;

        same_window:    (Window,    Window   ) -> Bool;
        same_rw_pixmap: (Rw_Pixmap, Rw_Pixmap) -> Bool;
        same_ro_pixmap: (Ro_Pixmap, Ro_Pixmap) -> Bool;

        # Sources for bitblt operations 
        #
        Draw_From
          = FROM_WINDOW     Window
          | FROM_RW_PIXMAP  Rw_Pixmap
          | FROM_RO_PIXMAP  Ro_Pixmap
          ;

        depth_of_window:    Window    -> Int;
        depth_of_rw_pixmap: Rw_Pixmap -> Int;
        depth_of_ro_pixmap: Ro_Pixmap -> Int;
        depth_of_draw_src:  Draw_From -> Int;

        id_of_window:    Window    -> Int;
        id_of_rw_pixmap: Rw_Pixmap -> Int;
        id_of_ro_pixmap: Ro_Pixmap -> Int;

        shape_of_window
            :
            Window
            ->
            { upperleft:     g2d::Point,                # Pixel location of window upper-left corner relative to parent.
              size:          g2d::Size,         # Pixel size of window. 
              #
              depth:         Int,               # Pixel depth in bits.
              border_thickness:  Int            # Window border in pixels.
            };

        shape_of_rw_pixmap
            :
            Rw_Pixmap
            ->
            { upperleft:     g2d::Point,                # Present only for uniformity;  these have no actual position.  Always (0,0).
              size:          g2d::Size,
              #
              depth:         Int,
              border_thickness:  Int            # Present only for uniformity;  these have no actual border.    Always 0.
            };

        shape_of_ro_pixmap
            :
            Ro_Pixmap
            ->
            { upperleft:     g2d::Point,                # Present only for uniformity;  these have no actual position.  Always (0,0).
              size:          g2d::Size,
              #
              depth:         Int,
              border_thickness:  Int            # Present only for uniformity;  these have no actual border.    Always 0.
            };

        shape_of_draw_src
            :
            Draw_From
            ->
            { upperleft:     g2d::Point,
              size:          g2d::Size,
              #
              depth:         Int,
              border_thickness:  Int
            };

        size_of_window:         Window -> g2d::Size;
        size_of_rw_pixmap:   Rw_Pixmap -> g2d::Size;
        size_of_ro_pixmap:   Ro_Pixmap -> g2d::Size;

        package r: api {
            #
            Window_Or_Pixmap
              #
              = WINDOW  Window
              | PIXMAP  Rw_Pixmap
              ;
        };

        Drawable
            =
            DRAWABLE
              {
                root:           r::Window_Or_Pixmap,
                to_drawimp:     di::d::Draw_Op -> Void          # This goes to WINDOW.to_hostwindow_drawimp or PIXMAP.to_screen_drawimp.
              };

        drawable_of_window:        Window -> Drawable;
        drawable_of_rw_pixmap:  Rw_Pixmap -> Drawable;

        depth_of_drawable:  Drawable -> Int;

        make_unbuffered_drawable:  Drawable -> Drawable;
            #
            # An unbuffered drawable is used to provide immediate
            # graphical response to user interaction.  (Currently
            # this is implemented by transparently adding a flush
            # command after each draw command.)
            #
            # This call is used in many of the src/lib/x-kit/tut
            # programs, for an example in:
            #
            #     src/lib/x-kit/widget/old/fancy/graphviz/get-mouse-selection.pkg

        flush_drawimp: (di::d::Draw_Op -> Void) -> Void;
            #
            # This is a lower-level version of  flush  from
            #     src/lib/x-kit/xclient/xclient.api
            # which is used in
            #     src/lib/x-kit/xclient/src/window/draw-old.pkg
            #     src/lib/x-kit/xclient/src/window/cs-pixmap-old.pkg    

        drawimp_thread_id_of: (di::d::Draw_Op -> Void) -> Int;
            #
            # This is a lower-level version of  drawimp_thread_id_of  from
            #     src/lib/x-kit/xclient/xclient.api
    };

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