# 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/old/fancy/graphviz/text/text-display.pkg # geometry2d is from
src/lib/std/2d/geometry2d.pkgstipulate
package g2d= geometry2d; # geometry2d is from
src/lib/std/2d/geometry2d.pkg package tw = text_widget; # text_widget is from
src/lib/x-kit/widget/old/text/text-widget.pkg #
package tc = text_canvas; # text_canvas is from
src/lib/x-kit/widget/old/fancy/graphviz/text/text-canvas.pkgherein
api Text_Poolx {
Text_Pool;
resize: (Text_Pool, g2d::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: g2d::Point,
elems: List( tc::Text_Elem )
};
#
# Return the text of the given row.
get_text
:
Text_Pool
->
{ row: Int,
start: Int,
stop: Int
}
->
{ at: g2d::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_Point)
->
Int;
#
# Return the x-coordinate of a character coordinate.
coord_to_pt
:
(Text_Pool, tw::Char_Point)
->
g2d::Point;
#
# Map a character coordinate to the
# origin of its bounding rectangle.
coord_to_rectangle
:
(Text_Pool, tw::Char_Point)
->
g2d::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_Point)
->
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_Point;
#
# Given a row and x-coordinate,
# return the full character coordinate.
point_to_coordinate
:
(Text_Pool, g2d::Point)
->
tw::Char_Point;
#
# Map a point to a character coordinate.
}; # api Text_Pool
end;