PreviousUpNext

15.3.684  src/lib/x-kit/widget/old/fancy/graphviz/text/ml-source-code-viewer.api

# ml-source-code-viewer.api
#
# This is a ML source code viewer, which is a test application for
# the new text widget.

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

# This api is implemented in:
#     src/lib/x-kit/widget/old/fancy/graphviz/text/ml-source-code-viewer.pkg

stipulate
    package xc =  xclient;                              # xclient       is from   src/lib/x-kit/xclient/xclient.pkg
    #
    package wg =  widget;                               # widget        is from   src/lib/x-kit/widget/old/basic/widget.pkg
    #
    package vb =  view_buffer;                          # view_buffer   is from   src/lib/x-kit/widget/old/fancy/graphviz/text/view-buffer.pkg
herein

    api Ml_Source_Code_Viewer {

        Viewer;

        Face = FACE { font:   Null_Or( xc::Font ),
                      color:  Null_Or( xc::Color_Spec )
                    };

        make_viewer
            :
            wg::Root_Window
            ->
            {
              font:       xc::Font,
              comm_face:  Face,
              kw_face:    Face,
              sym_face:   Face,
              id_face:    Face,
              background: xc::Color_Spec,
              # 
              src:        List( List { space: Int,
                                       kind:  vb::Token_Kind,
                                       text:  String
                                     }
                              )
            }
            ->
            Viewer;

        as_widget:  Viewer -> wg::Widget;

        view_of:    Viewer -> { view_start:  Int,
                                view_ht:     Int,
                                nlines:      Int
                              };

        scroll_view:  (Viewer, Int) -> Void;

    };

end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext