PreviousUpNext

15.4.1563  src/lib/x-kit/widget/theme/gadget-to-pixmap.pkg

## gadget-to-pixmap.pkg
#
# Client (app-code or widget-code) interface to drawing on
# pixmaps in the X server (or someday, other window system).
#
# For the big picture see the imp dataflow diagrams in
#
#     src/lib/x-kit/xclient/src/window/xclient-ximps.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 gd  =  gui_displaylist;                                                                                     # gui_displaylist               is from   src/lib/x-kit/widget/theme/gui-displaylist.pkg
    package mtx =  rw_matrix;                                                                                           # rw_matrix                     is from   src/lib/std/src/rw-matrix.pkg
    package r8  =  rgb8;                                                                                                # rgb8                          is from   src/lib/x-kit/xclient/src/color/rgb8.pkg
    package g2d =  geometry2d;                                                                                          # geometry2d                    is from   src/lib/std/2d/geometry2d.pkg
herein

    package gadget_to_pixmap {
        #
        Gadget_To_Rw_Pixmap
          =
          { id:                                 Id,                                                                     # Unique id to facilitate storing instances in indexed datastructures like red-black trees.
            #
            size:                               g2d::Size,

            get_pixel_rectangle:                g2d::Box -> mtx::Rw_Matrix( r8::Rgb8 ),                                 # Arg is pixel rectangle to read, in window coordinates. Result is RGB values for those pixels. NB: Results are undefined if window is not fully visible.
            #
            pass_pixel_rectangle:               g2d::Box -> Replyqueue                                                  # Nonblocking version of previous, for imps.
                                                         -> (mtx::Rw_Matrix(r8::Rgb8) -> Void)
                                                         -> Void,

            draw_displaylist:                   gd::Gui_Displaylist -> Void,                                            # This call lets guiboss draw widgets etc.

            free_rw_pixmap:                     Void -> Void                                                            # Release all resources (e.g., X-server offscreen storage) associated with pixmap. After this call
                                                                                                                        # All Void-valued calls to this gadget_to_rw_pixmap instance will be silently ignored,
                                                                                                                        # all other calls will be fatal errors.
          };
    };                                                                                                                  # package appwindow;
end;




Comments and suggestions to: bugs@mythryl.org

PreviousUpNext