PreviousUpNext

15.3.637  src/lib/x-kit/widget/fancy/graphviz/text/text-pool.api

# text-pool.api

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

# This specified the argument type to generic package text_display_g,
# which no longer exists.
# See:
#     src/lib/x-kit/widget/fancy/graphviz/text/text-display.pkg

                                                # xgeometry     is from   src/lib/std/2d/xgeometry.pkg
stipulate
    package xg =  xgeometry;                    # xgeometry     is from   src/lib/std/2d/xgeometry.pkg
    package tw =  text_widget;                  # text_widget   is from   src/lib/x-kit/widget/text/text-widget.pkg
    #
    package tc =  text_canvas;                  # text_canvas   is from   src/lib/x-kit/widget/fancy/graphviz/text/text-canvas.pkg
herein
    api Text_Poolx {

        Text_Pool;

        resize:  (Text_Pool, xg::Size) -> Void;
            #
            # Notify the text-pool of a change in
            # the associated canvas's size.
            # This is called by text_display::Resize.


        num_rows:  Text_Pool -> Int;                            #  ??? 
            #
            # Return number of rows in the text pool.
            # Note that this should cover the canvas:
            # there should be no pixels in the canvas
            # that are not mapped to a row.


        max_cols:  Text_Pool -> Int;
            # Return the maximum number of displayed
            # columns in any row;

        get_row
            :
            Text_Pool
            ->
            Int
            ->
            { at:     xg::Point,
              elems:  List( tc::Text_Elem )
            };
            #
            # Return the text of the given row.

        get_text
            :
            Text_Pool
            ->
            { row:    Int,
              start:  Int,
              stop:   Int
            }
            ->
            { at:     xg::Point,
              elems:  List( tc::Text_Elem )
            };
            #
            # Return the text elements in the
            # given row between the start and
            # stop character positions (inclusive),
            # along with the origin of the first element.


        get_row_ht
            :
            (Text_Pool, Int) -> Int;
            #
            # Return the height of the given row.

        get_row_scent
            :
            (Text_Pool, Int)
            ->
            { ascent:   Int,
              descent:  Int
            };
            #
            # Return the ascent and descent of the given row.

        baseline_of_row
            :
            (Text_Pool, Int) -> Int;
            #
            # Return the y-coordinate of a row's baseline.
            # This is the same as the y-coordinate (row_to_y)
            # plus the ascent.


        pixel_rng_to_row_rng
            :
            (Text_Pool, Int, Int)
            ->
            (Int, Int);
            #
            # Given an inclusive range of pixels
            # in the y-dimension return the
            # minimum inclusive range of rows
            # covered by the pixel range.


        pixel_rng_to_col_rng                            # "rng" == "range"
            :
            (Text_Pool, Int, Int, Int)
            ->
            (Int, Int);
            #
            # Given a row and an inclusive range of pixels
            # in the x-dimension return the minimum inclusive
            # range of columns covered in the row by the pixel range.


        row_to_y:  (Text_Pool, Int) -> Int;
            #
            # Return the y-coordinate of the top of a row. 

        coord_to_x
            :
            (Text_Pool, tw::Char_Coord)
            ->
            Int;
            #
            # Return the x-coordinate of a character coordinate.

        coord_to_pt
            :
            (Text_Pool, tw::Char_Coord)
            ->
            xg::Point;
            #
            # Map a character coordinate to the
            # origin of its bounding rectangle. 

        coord_to_rectangle
            :
            (Text_Pool, tw::Char_Coord)
            ->
            xg::Box;
            #
            # Map a character coordinate into a
            # rectangle bounding its contents.
            #
            # The height of the rectangle is the
            # row height (even if the character
            # height is smaller).


        coord_to_element
            :
            (Text_Pool, tw::Char_Coord)
            ->
            tc::Text_Elem;
            #
            # Map a character coordinate onto
            # the corresponding single-character 
            # typeballed type element.


        x_pos_to_coord
            :
            (Text_Pool, Int, Int)
            ->
            tw::Char_Coord;
            #
            # Given a row and x-coordinate,
            # return the full character coordinate.

        pt_to_coord
            :
            (Text_Pool, xg::Point)
            ->
            tw::Char_Coord;
            #
            # Map a point to a character coordinate. 

    };                  # api Text_Pool
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext