


## text-widget.api
#
# "The text widget is a low-level widget for managing a window of text.
# It provides limited highlighting, and a single font."
#
# -- p34, Gansner+Reppy's 1993 eXene widget manual,
# http:://mythryl.org/pub/exene/1993-widgets.ps
# Compiled by:
# src/lib/x-kit/widget/xkit-widget.sublib# A simple text widget: currently this only supports one fixed-width font (8x13).
### "The art of programming is the art of organising complexity,
### of mastering the multitude and avoiding its bastard chaos
### as effectively as possible."
###
### -- E J Dijkstra
# This api is implemented in:
#
# src/lib/x-kit/widget/text/text-widget.pkgstipulate
package wg = widget; # widget is from src/lib/x-kit/widget/basic/widget.pkg package xg = xgeometry; # xgeometry is from src/lib/std/2d/xgeometry.pkgherein
api Text_Widget {
Char_Coord
=
CHAR_COORD { col: Int,
row: Int
};
Text_Widget;
make_text_widget: wg::Root_Window -> { rows: Int, cols: Int } -> Text_Widget;
as_widget: Text_Widget -> wg::Widget;
char_size_of: Text_Widget -> { rows: Int, cols: Int };
size_of: Text_Widget -> xg::Size;
pt_to_coord: Text_Widget -> xg::Point -> Char_Coord;
coord_to_box: Text_Widget -> Char_Coord -> xg::Box;
scroll_up: Text_Widget -> { from: Int, nlines: Int } -> Void;
scroll_down: Text_Widget -> { from: Int, nlines: Int } -> Void;
write_text: Text_Widget -> { at: Char_Coord, text: String } -> Void;
highlight_text: Text_Widget -> { at: Char_Coord, text: String } -> Void;
insert_ln: Text_Widget -> { lnum: Int, text: String } -> Void;
insert_text: Text_Widget -> { at: Char_Coord, text: String } -> Void;
insert_highlight_text: Text_Widget -> { at: Char_Coord, text: String } -> Void;
delete_ln: Text_Widget -> Int -> Void;
delete_lns: Text_Widget -> { lnum: Int, nlines: Int } -> Void;
delete_chars: Text_Widget -> { at: Char_Coord, count: Int } -> Void;
clear_to_eol: Text_Widget -> Char_Coord -> Void;
clear_to_eos: Text_Widget -> Char_Coord -> Void;
clear: Text_Widget -> Void;
move_cursor: Text_Widget -> Char_Coord -> Void;
cursor_pos: Text_Widget -> Char_Coord;
cursor_on: Text_Widget -> Void;
cursor_off: Text_Widget -> Void;
};
end;
## COPYRIGHT (c) 1991 by AT&T Bell Laboratories. See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2013,
## released per terms of SMLNJ-COPYRIGHT.


