PreviousUpNext

15.3.630  src/lib/x-kit/widget/fancy/graphviz/graphviz-widget.api

## graphviz-widget.api
#
# Display a window a Graphviz-generated graph.
# This widget gets wrapped in two scrollbars by:
#     src/lib/x-kit/widget/fancy/graphviz/scrollable-graphviz-widget.pkg

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

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

stipulate
    include threadkit;
    #
    package vg  =  planar_graphtree;                            # planar_graphtree      is from   src/lib/std/dot/planar-graphtree.pkg
    package wg  =  widget;                                      # widget                is from   src/lib/x-kit/widget/basic/widget.pkg
    package ffc =  font_family_cache;                           # font_family_cache     is from   src/lib/x-kit/widget/fancy/graphviz/font-family-cache.pkg
herein

    api Graphviz_Widget {

        Graphviz_Widget;

        make_graphviz_widget
            :
            (ffc::Font_Family_Cache, wg::Root_Window)
            -> vg::Traitful_Graph
            -> Graphviz_Widget;

        as_widget:  Graphviz_Widget -> wg::Widget;

        Viewdim
            =
            VIEWDIM
              { min:   Int,
                size:  Int,
                total: Int
              };

        set_horizontal_view:  Graphviz_Widget -> Int -> Void;
        set_vertical_view:    Graphviz_Widget -> Int -> Void;

        # This mailop is used by the graphviz widget to move
        # the scrollbar thumbs to reflect changes in which
        # part of the graph is currently visible:
        # 
        to_scrollbars_mailop_of
            :
            Graphviz_Widget
            ->
            Mailop
              { horizontal:  Viewdim,
                vertical:    Viewdim
              };
    };

end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext