PreviousUpNext

15.3.636  src/lib/x-kit/widget/fancy/graphviz/text/text-display.api

# text-display.api

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

# This api is implemented in:
#     src/lib/x-kit/widget/fancy/graphviz/text/text-display.pkg

stipulate
    include threadkit;                                          # threadkit     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    #
    package xg  =  xgeometry;                                   # xgeometry     is from   src/lib/std/2d/xgeometry.pkg
    #
#   package wg  =  widget;                                      # widget        is from   src/lib/x-kit/widget/basic/widget.pkg
    package tc  =  text_canvas;                                 # text_canvas   is from   src/lib/x-kit/widget/fancy/graphviz/text/text-canvas.pkg
    package tw  =  text_widget;                                 # text_widget   is from   src/lib/x-kit/widget/text/text-widget.pkg
    #
    package vb  =  view_buffer;                                 # view_buffer   is from   src/lib/x-kit/widget/fancy/graphviz/text/view-buffer.pkg
herein

    api Text_Display {

        Text_Display;

        make_text_display
            :
            { canvas:  tc::Text_Canvas,
              text:    vb::Text_Pool,
              size:    xg::Size
            }
            ->
            Text_Display;

        resize:  (Text_Display, xg::Size) -> Void;
            #
            # Update the size of the display.

        size_of:  Text_Display -> xg::Size;
            #
            # Return size.

        make_typeball
            :
            (Text_Display,  List( tc::Typeball_Val ))
            ->
            tc::Typeball;
            #
            # Return a typeball for the display. 

        default_typeball:  Text_Display -> tc::Typeball;
            #
            # Return the default typeball for the display. 

        copy_typeball
            :
            (tc::Typeball,  List( tc::Typeball_Val ))
            ->
            tc::Typeball;
            #
            # Copy a typeball, updating some traits.

        scroll_v
            :
            Text_Display
            ->
            { from:  Int,
              to:    Int,
              high:  Int
            }
            ->
            { vacated:  xg::Box,
              damage:   Mailop(  List(  xg::Box ) )
            };
            #
            # Scroll a region vertically, returning the
            # vacated rectangle and a list of damaged
            # rectangles that must be redrawn.
            #
            # The region coordinates are in pixels:
            #   "from" is the y-coord of the top of the region;
            #   "high" is the height of the region; and
            #   "to"   is the y-coord of the new top of the region.

        scroll_h
            :
            Text_Display
            ->
            { from:  Int,
              to:    Int,
              wide:  Int
            }
            ->
            { vacated:  xg::Box,
              damage:   Mailop(  List(  xg::Box ) )
            };
            #
            # Scroll a region horizontally, returning the
            # vacated rectangle and a list of damaged
            # rectangles that must be redrawn.
            #
            # The region coordinates are in pixels:
            #   "from" is the x-coord of the l::h.s. of the region;
            #   "wide" is the width of the region; and
            #   "to" is the x-coord of new l::h.s. of the region.

        scroll_line
            :
            Text_Display
            ->
            { from:  tw::Char_Coord,
              to:    Int,
              wide:  Int
            }
            ->
            { vacated:  xg::Box,
              damage:   Mailop(  List(  xg::Box ) )
            };
            #
            # Scroll the contents of a line horizontally. 

        scroll_up
            :
            Text_Display
            ->
            Int
            ->
            { vacated:  xg::Box,
              damage:   Mailop(  List(  xg::Box ) )
            };
            #
            # Scroll the text vertically so that
            # the specified row is at the top of
            # the display (i.e., scroll the text
            # up by the specified number of rows.

        scroll_down
            :
            Text_Display
            ->
            Int
            ->
            { vacated:  xg::Box,
              damage:   Mailop(  List(  xg::Box ) )
            };
            #
            # Scroll the text vertically so that
            # the top of the screen occupies the
            # specified row (i.e., scroll the text
            # down by the specified number of rows.

        clear_box
            :
            Text_Display
            ->
            xg::Box
            ->
            Void;
            #
            # Clear the specified rectangle.

        clear_to_eol
            :
            Text_Display
            ->
            tw::Char_Coord
            ->
            Void;
            #
            # Clear from the character coordinate
            # to the end of its line.

        clear_lines
            :
            Text_Display
            ->
            { start:  Int,
              stop:   Int
            }
            ->
            Void;
            #
            # Clear the lines [start..stop].

        clear_area
            :
            Text_Display
            ->
            { start:  tw::Char_Coord,
              stop:   tw::Char_Coord
            }
            ->
            Void;
            #
            # Clear the area from the coordinate
            # start to the coordinate stop. 

        redraw
            :
            Text_Display
            ->
            List( xg::Box )
            ->
            Void;
            #
            #  Redraw the damaged region.

    };                  # api Text_Display

end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext