PreviousUpNext

15.3.717  src/lib/x-kit/widget/old/lib/widget-attribute-old.api

## widget-attribute-old.api

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

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

stipulate
    package d3 =  three_d;                              # three_d       is from   src/lib/x-kit/widget/old/lib/three-d.pkg
    package qk =  quark;                                # quark         is from   src/lib/x-kit/style/quark.pkg
    package wb =  widget_base;                          # widget_base   is from   src/lib/x-kit/widget/old/basic/widget-base.pkg
    package wt =  widget_types;                         # widget_types  is from   src/lib/x-kit/widget/old/basic/widget-types.pkg
    package xc =  xclient;                              # xclient       is from   src/lib/x-kit/xclient/xclient.pkg
herein

    api Widget_Attribute_Old {
        #
        Context;

        Name = qk::Quark;

        active:                 Name;                   #  "active" 
        aspect:                 Name;                   #  "aspect" 
        arrow_dir:              Name;                   #  "arrowDir" 

        background:             Name;                   #  "background" 
        border_color:           Name;                   #  "borderColor" 
        border_thickness:       Name;                   #  "borderWidth" 

        color:                  Name;                   #  "color" 
        current:                Name;                   #  "current" 
        cursor:                 Name;                   #  "cursor" 

        font:                   Name;                   #  "font" 
        font_list:              Name;                   #  "fontList" 
        font_size:              Name;                   #  "fontSize" 

        foreground:             Name;                   #  "foreground" 
        from_value:             Name;                   #  "fromValue" 
        gravity:                Name;                   #  "gravity" 

        halign:                 Name;                   #  "halign" 
        height:                 Name;                   #  "height" 

        icon_name:              Name;                   #  "iconName" 
        is_active:              Name;                   #  "is_active" 
        is_set:                 Name;                   #  "isSet" 
        is_vertical:            Name;                   #  "isVertical" 

        label:                  Name;                   #  "label" 
        length:                 Name;                   #  "length" 

        padx:                   Name;                   #  "padx" 
        pady:                   Name;                   #  "pady" 

        ready_color:            Name;                   #  "readyColor" 
        relief:                 Name;                   #  "relief" 
        repeat_delay:           Name;                   #  "repeatDelay" 

        repeat_interval:        Name;                   #  "repeatInterval" 
        rounded:                Name;                   #  "rounded" 

        scale:                  Name;                   #  "scale" 
        select_color:           Name;                   #  "selectColor" 
        select_background:      Name;                   #  "selectBackground" 

        select_border_thickness:        Name;                   #  "selectBorderWidth" 
        select_foreground:      Name;                   #  "selectForeground" 
        show_value:             Name;                   #  "showValue" 
        state:                  Name;                   #  "state" 

        text:                   Name;                   #  "text" 
        thumb_length:           Name;                   #  "thumbLength" 
        tick_interval:          Name;                   #  "tickInterval" 

        tile:                   Name;                   #  "tile" 
        title:                  Name;                   #  "title" 
        to_value:               Name;                   #  "toValue" 
        type:                   Name;                   #  "type" 

        valign:                 Name;                   #  "valign" 
        width:                  Name;                   #  "width" 

        Type
          = STRING
          | INT
          | FLOAT
          | BOOL
          | FONT
          | COLOR
          | COLOR_SPEC
          | TILE
          | CURSOR
          | HALIGN
          | VALIGN
          | RELIEF
          | ARROW_DIR
          | GRAVITY
          ;

        Value
          = STRING_VAL      String
          | INT_VAL         Int
          # 
          | FLOAT_VAL       Float
          | BOOL_VAL        Bool
          # 
          | FONT_VAL        xc::Font
          | COLOR_VAL       xc::Rgb
          | COLOR_SPEC_VAL  xc::Color_Spec
          # 
          | TILE_VAL        xc::Ro_Pixmap
          | CURSOR_VAL      xc::Xcursor
          # 
          | HALIGN_VAL      wt::Horizontal_Alignment
          | VALIGN_VAL      wt::Vertical_Alignment
          # 
          | RELIEF_VAL      d3::Relief
          # 
          | ARROW_DIR_VAL   wt::Arrow_Direction
          | GRAVITY_VAL     wt::Gravity
          | NO_VAL
          ;

        no_val: Value;

        exception BAD_ATTRIBUTE_VALUE;
        exception NO_CONVERSION;

        convert_string:           Context -> (String, Type) -> Value;
        convert_attribute_value:  Context -> (Value,  Type) -> Value;

        same_value:      (Value, Value) -> Bool;
        same_type:       (Value, Type)  -> Bool;

        get_int:                Value -> Int;
        get_float:              Value -> Float;
        #
        get_bool:               Value -> Bool;
        get_string:             Value -> String;
        #
        get_color:              Value -> xc::Rgb;
        get_color_spec:         Value -> xc::Color_Spec;
        #
        get_font:               Value -> xc::Font;
        get_tile:               Value -> xc::Ro_Pixmap;
        get_cursor:             Value -> xc::Xcursor;
        #
        get_halign:             Value -> wt::Horizontal_Alignment;
        get_valign:             Value -> wt::Vertical_Alignment;
        #
        get_relief:             Value -> d3::Relief;
        get_arrow_dir:          Value -> wt::Arrow_Direction;
        get_gravity:            Value -> wt::Gravity;

        get_int_opt:            Value -> Null_Or( Int );
        get_float_opt:          Value -> Null_Or( Float );
        #
        get_bool_opt:           Value -> Null_Or( Bool );
        get_string_opt:         Value -> Null_Or( String );
        #
        get_color_opt:          Value -> Null_Or( xc::Rgb );
        get_color_spec_opt:     Value -> Null_Or( xc::Color_Spec );
        #
        get_font_opt:           Value -> Null_Or( xc::Font );
        get_tile_opt:           Value -> Null_Or( xc::Ro_Pixmap );
        get_cursor_opt:         Value -> Null_Or( xc::Xcursor );
        #
        get_halign_opt:         Value -> Null_Or( wt::Horizontal_Alignment );
        get_valign_opt:         Value -> Null_Or( wt::Vertical_Alignment );
        #
        get_relief_opt:         Value -> Null_Or( d3::Relief );
        get_gravity_opt:        Value -> Null_Or( wt::Gravity );

    };
end;

## COPYRIGHT (c) 1994 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext