PreviousUpNext

15.4.875  src/lib/src/gtk-g.pkg

# gtk-g.pkg
#
# Here we handle the low-level Gtk-binding functionality
# common to our Gtk-in-main-process and Gtk-in-subprocess
# implementations;  the functionality specific to those two
# is handled by gtk_driver and gtk_via_pipe_driver.                             # gtk_driver            is from   src/lib/src/gtk-driver.pkg
#                                                                               # gtk_via_pipe_driver   is from   src/lib/src/gtk-via-pipe-driver.pkg

# Compiled by:
#     src/lib/std/standard.lib

# Autogeneration of parts of this file done by:
#
#     src/lib/src/make-gtk-glue
# per src/lib/src/gtk-glue.config

# Unit tests in:
#     src/lib/src/gtk-via-pipe-unit-test.pkg

# Compare with:
#     src/lib/src/easy-gtk.pkg

# The other end of the pipe is implemented in:
#     src/c/gtk/mythryl-gtk-slave.c
#
# See the comments in that file for a description
# of the pipe protocol used.



###             "Each design decision constrains all subsequent
###              design decisions, making each successive design
###              problem harder to solve.  Tackle the hardest
###              design problems first, when you have the greatest
###              freedom to maneuver."


# This generic is invoked once each for
# our Gtk-in-main-processs
# and Gtk-in-subprocess
# implementations:
#
#     src/lib/src/gtk.pkg
#     src/lib/src/gtk-via-pipe.pkg
#
#
generic package   gtk_g   (
    #             ===== 
    drv: Gtk_Driver                                                             # Gtk_Driver            is from   src/lib/src/gtk-driver.api
        #
        # When called by gtk.pkg             drv == gtk_driver                  # gtk_driver            is from   src/lib/src/gtk-driver.pkg
        # When called by gtk-vira-pipe.pkg   drv == gtk_via_pipe_driver         # gtk_via_pipe_driver   is from   src/lib/src/gtk-via-pipe-driver.pkg
)
:
Gtk                                                                             # Gtk                   is from   src/lib/src/gtk.api
{
    include gtk_event;                                                          # gtk_event             is from   src/lib/src/gtk-event.pkg

# Do not edit this or following lines -- they are autogenerated by make-gtk-glue.

    Event_Mask
        = EXPOSURE_MASK
        | POINTER_MOTION_MASK
        | POINTER_MOTION_HINT_MASK
        | BUTTON_MOTION_MASK
        | BUTTON1_MOTION_MASK
        | BUTTON2_MOTION_MASK
        | BUTTON3_MOTION_MASK
        | BUTTON_PRESS_MASK
        | BUTTON_RELEASE_MASK
        | KEY_PRESS_MASK
        | KEY_RELEASE_MASK
        | ENTER_NOTIFY_MASK
        | LEAVE_NOTIFY_MASK
        | FOCUS_CHANGE_MASK
        | STRUCTURE_MASK
        | PROPERTY_CHANGE_MASK
        | PROXIMITY_IN_MASK
        | PROXIMITY_OUT_MASK
        ;

    Void_Callback            =  Void                       ->  Void;
    Bool_Callback            =  Bool                       ->  Void;
    Float_Callback           =  Float                      ->  Void;
    Button_Event_Callback    =  gtk_event::Button_Event    ->  Void;                                             #                                                               # http://library.gnome.org/devel/gdk/stable/gdk-Event-Structures.html#GdkEventButton
    Key_Event_Callback       =  gtk_event::Key_Event       ->  Void;                                             #                                                               # http://library.gnome.org/devel/gdk/stable/gdk-Event-Structures.html#GdkEventKey
    Expose_Event_Callback    =  gtk_event::Expose_Event    ->  Void;                                             #                                                               # http://library.gnome.org/devel/gdk/stable/gdk-Event-Structures.html#GdkEventExpose    
    Motion_Event_Callback    =  gtk_event::Motion_Event    ->  Void;                                             #                                                               # http://library.gnome.org/devel/gdk/stable/gdk-Event-Structures.html#GdkEventMotion
    Configure_Event_Callback =  gtk_event::Configure_Event ->  Void;                                             #                                                               # http://library.gnome.org/devel/gdk/stable/gdk-Event-Structures.html#GdkEventConfigure

    Pack_From
        =
        FROM_START | FROM_END;

        Arrow_Direction
            = ARROW_UP
            | ARROW_DOWN
            | ARROW_LEFT
            | ARROW_RIGHT;

        Shadow_Style
            = SHADOW_NONE
            | SHADOW_IN
            | SHADOW_OUT
            | SHADOW_ETCHED_IN
            | SHADOW_ETCHED_OUT;

        Metric = PIXELS | INCHES | CENTIMETERS;

        Scrollbar_Policy
            = POLICY_AUTOMATIC
            | POLICY_ALWAYS;

        Justification
            = JUSTIFY_LEFT
            | JUSTIFY_RIGHT
            | JUSTIFY_CENTER
            | JUSTIFY_FILL;

    Position_Type
        =
        POSITION_LEFT   |
        POSITION_RIGHT  |
        POSITION_TOP    |
        POSITION_BOTTOM ;

        Update_Policy
            =
            CONTINUOUS_UPDATES    |
            DISCONTINUOUS_UPDATES |
            DELAYED_UPDATES       ;

        Table_Attach_Option
            =
            TABLE_FILL | TABLE_SHRINK | TABLE_EXPAND;

# Do not edit this or preceding lines -- they are autogenerated by make-gtk-glue.

    package int_map
        =
        int_red_black_map;

    Session
        =
        { subsession:             drv::Session,

          # The callback maps let us find the appropriate
          # Mythryl callback function to run when our GTK
          # slave process says to run callback #127 or such.
          #
          # To keep the typechecker happy we need a separate
          # map for each callback type:
          #
          void_callback_map:            Ref( int_map::Map( Void            -> Void )),
          bool_callback_map:            Ref( int_map::Map( Bool            -> Void )),
          float_callback_map:           Ref( int_map::Map( Float           -> Void )),
          button_event_callback_map:    Ref( int_map::Map( Button_Event    -> Void )),
          motion_event_callback_map:    Ref( int_map::Map( Motion_Event    -> Void )),
          key_event_callback_map:       Ref( int_map::Map( Key_Event       -> Void )),
          expose_event_callback_map:    Ref( int_map::Map( Expose_Event    -> Void )),
          configure_event_callback_map: Ref( int_map::Map( Configure_Event -> Void )),

          widget_tree:         Ref( Widget ),

          # The "easy_id" map is support for easy-gtk.{api,pkg},
          # where widgets are constructed from tree structured
          # specifications and thus lack natural names; assigning
          # a widget a text "easy_id" name allows it to be retrieved
          # later by name if needed:
          #
          widgets_by_easy_id:  Ref( string_map::Map( Widget ) )
        };

    #
    fun set_easy_id (session: Session, id, widget)
        =
        session.widgets_by_easy_id
            :=
            string_map::set( *session.widgets_by_easy_id, id, widget );

    #
    fun drop_easy_id (session: Session, id)
        =
        session.widgets_by_easy_id
            :=
            #1 (string_map::drop (*session.widgets_by_easy_id, id ) );

    #
    fun get_by_easy_id (session: Session, id)
        =
        the (string_map::get( *session.widgets_by_easy_id, id ) );



    stipulate


    herein



        #
        fun sum_table_attach_options  options
            =
            sum_options' (options, 0)
            where
                fun sum_options' ([], result)
                        =>
                        result;

                    sum_options' (option ! rest, result)
                        =>
                        {   value
                                =
                                case option
                                    TABLE_EXPAND => 1;
                                    TABLE_SHRINK => 2;
                                    TABLE_FILL   => 4;
                                esac;

                            sum_options' (rest, result + value);
                        };
                end;
            end;





        #
        fun destroy_widget_tree  (session: Session)
            =
            drv::destroy_widget (session.subsession, *session.widget_tree);     # Note break in pattern -- there is no drv::destroy_widget_tree.


        #
        fun run_eventloop_indefinitely (session: Session)
            =
            drv::run_eventloop_indefinitely session.subsession;

        #
        fun run_eventloop_once { session: Session, block_until_event: Bool }
            =
            drv::run_eventloop_once (session.subsession, block_until_event);

        #
        fun make_session []
                =>
                {
                    void_callback_map            =  REF (int_map::empty:   int_map::Map( Void            -> Void ));
                    bool_callback_map            =  REF (int_map::empty:   int_map::Map( Bool            -> Void ));
                    float_callback_map           =  REF (int_map::empty:   int_map::Map( Float           -> Void ));
                    button_event_callback_map    =  REF (int_map::empty:   int_map::Map( Button_Event    -> Void ));
                    motion_event_callback_map    =  REF (int_map::empty:   int_map::Map( Motion_Event    -> Void ));
                    key_event_callback_map       =  REF (int_map::empty:   int_map::Map( Key_Event       -> Void ));
                    expose_event_callback_map    =  REF (int_map::empty:   int_map::Map( Expose_Event    -> Void ));
                    configure_event_callback_map =  REF (int_map::empty:   int_map::Map( Configure_Event -> Void ));

                    subsession
                        =
                        drv::make_session
                            {
                              void_callback_map,
                              bool_callback_map,
                              float_callback_map,
                              button_event_callback_map,
                              motion_event_callback_map,
                              key_event_callback_map,
                              expose_event_callback_map,
                              configure_event_callback_map
                            };

                    session
                        =
                        { subsession,

                          widget_tree                  => REF 0,

                          void_callback_map,
                          bool_callback_map,
                          float_callback_map,
                          button_event_callback_map,
                          motion_event_callback_map,
                          key_event_callback_map,
                          expose_event_callback_map,
                          configure_event_callback_map,

                          widgets_by_easy_id           => REF (string_map::empty)
                        };

                    session;
                };

            make_session (arg ! args)
                =>
                raise exception GTK_ERROR "make_session: args not supported yet.";
        end;



# Do not edit this or following lines -- they are autogenerated by make-gtk-glue.

        #
        fun pack_to_int  pack
            =
            case pack
              
                 FROM_START => 0;
                 FROM_END   => 1;
            esac;

        #
        fun null_or_widget_to_int  NULL        =>  0;
            null_or_widget_to_int (THE widget) =>  widget;
        end;

        #
        fun metric_to_int metric
            =
            case metric

                 PIXELS      => 0;
                 INCHES      => 1;
                 CENTIMETERS => 2;
            esac;

        #
        fun scrollbar_policy_to_int  scrollbar_policy
            =
            case scrollbar_policy

                 POLICY_AUTOMATIC => 0;
                 POLICY_ALWAYS    => 1;
            esac;

        #
        fun justification_to_int JUSTIFY_LEFT     => 0;
            justification_to_int JUSTIFY_RIGHT    => 1;
            justification_to_int JUSTIFY_CENTER   => 2;
            justification_to_int JUSTIFY_FILL     => 3;
        end;

        #
        fun arrow_direction_to_int  ARROW_UP    => 0;
            arrow_direction_to_int  ARROW_DOWN  => 1;
            arrow_direction_to_int  ARROW_LEFT  => 2;
            arrow_direction_to_int  ARROW_RIGHT => 3;
        end;

        #
        fun shadow_style_to_int  SHADOW_NONE       => 0;
            shadow_style_to_int  SHADOW_IN         => 1;
            shadow_style_to_int  SHADOW_OUT        => 2;
            shadow_style_to_int  SHADOW_ETCHED_IN  => 3;
            shadow_style_to_int  SHADOW_ETCHED_OUT => 4;
        end;

        #
        fun position_to_int  POSITION_LEFT       => 0;
            position_to_int      POSITION_RIGHT  => 1;
            position_to_int      POSITION_TOP    => 2;
            position_to_int      POSITION_BOTTOM => 3;
        end;

        #
        fun bool_to_string bool
            =
            case bool
              
                 TRUE  => "TRUE";
                 FALSE => "FALSE";
            esac;



        stipulate

            exposure            =  1 <<  0;
            pointer_motion      =  1 <<  1;
            pointer_motion_hint =  1 <<  2;
            button_motion       =  1 <<  3;
            button1_motion      =  1 <<  4;
            button2_motion      =  1 <<  5;
            button3_motion      =  1 <<  6;
            button_press        =  1 <<  7;
            button_release      =  1 <<  8;
            key_press           =  1 <<  9;
            key_release         =  1 << 10;
            enter_notify        =  1 << 11;
            leave_notify        =  1 << 12;
            focus_change        =  1 << 13;
            structure           =  1 << 14;
            property_change     =  1 << 15;
            proximity_in        =  1 << 16;
            proximity_out       =  1 << 17;
            #

        herein

            #
            fun events_to_int events
                =
                events_to_int' (events, 0)
                where
                    fun events_to_int' ([], result)
                            =>
                            result;

                        events_to_int' (event ! events, result)
                            =>
                            case event

                                 EXPOSURE_MASK            =>  events_to_int' (events, result | exposure            );
                                 POINTER_MOTION_MASK      =>  events_to_int' (events, result | pointer_motion      );
                                 POINTER_MOTION_HINT_MASK =>  events_to_int' (events, result | pointer_motion_hint );
                                 BUTTON_MOTION_MASK       =>  events_to_int' (events, result | button_motion       );
                                 BUTTON1_MOTION_MASK      =>  events_to_int' (events, result | button1_motion      );
                                 BUTTON2_MOTION_MASK      =>  events_to_int' (events, result | button2_motion      );
                                 BUTTON3_MOTION_MASK      =>  events_to_int' (events, result | button3_motion      );
                                 BUTTON_PRESS_MASK        =>  events_to_int' (events, result | button_press        );
                                 BUTTON_RELEASE_MASK      =>  events_to_int' (events, result | button_release      );
                                 KEY_PRESS_MASK           =>  events_to_int' (events, result | key_press           );
                                 KEY_RELEASE_MASK         =>  events_to_int' (events, result | key_release         );
                                 ENTER_NOTIFY_MASK        =>  events_to_int' (events, result | enter_notify        );
                                 LEAVE_NOTIFY_MASK        =>  events_to_int' (events, result | leave_notify        );
                                 FOCUS_CHANGE_MASK        =>  events_to_int' (events, result | focus_change        );
                                 STRUCTURE_MASK           =>  events_to_int' (events, result | structure           );
                                 PROPERTY_CHANGE_MASK     =>  events_to_int' (events, result | property_change     );
                                 PROXIMITY_IN_MASK        =>  events_to_int' (events, result | proximity_in        );
                                 PROXIMITY_OUT_MASK       =>  events_to_int' (events, result | proximity_out       );
                            esac;
                    end; 
                end; 
        end;

        #
        fun update_policy_to_int  CONTINUOUS_UPDATES    =>  0;
            update_policy_to_int  DISCONTINUOUS_UPDATES =>  1;
            update_policy_to_int  DELAYED_UPDATES       =>  2;
        end;


        #
        fun make_window (session: Session)
            =
            drv::make_window  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_label (session: Session, label)
            =
            drv::make_label (session.subsession, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_status_bar_context_id (session: Session, status_bar, description)
            =
            drv::make_status_bar_context_id (session.subsession, status_bar, description);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_menu (session: Session)
            =
            drv::make_menu  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_option_menu (session: Session)
            =
            drv::make_option_menu  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_menu_bar (session: Session)
            =
            drv::make_menu_bar  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_combo_box (session: Session)
            =
            drv::make_combo_box  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_text_combo_box (session: Session)
            =
            drv::make_text_combo_box  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_frame (session: Session, label)
            =
            drv::make_frame (session.subsession, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_button (session: Session)
            =
            drv::make_button  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_button_with_label (session: Session, label)
            =
            drv::make_button_with_label (session.subsession, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_button_with_mnemonic (session: Session, mnemonic_label)
            =
            drv::make_button_with_mnemonic (session.subsession, mnemonic_label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_toggle_button (session: Session)
            =
            drv::make_toggle_button  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_toggle_button_with_label (session: Session, label)
            =
            drv::make_toggle_button_with_label (session.subsession, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_toggle_button_with_mnemonic (session: Session, mnemonic_label)
            =
            drv::make_toggle_button_with_mnemonic (session.subsession, mnemonic_label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_check_button (session: Session)
            =
            drv::make_check_button  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_check_button_with_label (session: Session, label)
            =
            drv::make_check_button_with_label (session.subsession, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_check_button_with_mnemonic (session: Session, mnemonic_label)
            =
            drv::make_check_button_with_mnemonic (session.subsession, mnemonic_label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_menu_item (session: Session)
            =
            drv::make_menu_item  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_menu_item_with_label (session: Session, label)
            =
            drv::make_menu_item_with_label (session.subsession, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_menu_item_with_mnemonic (session: Session, mnemonic_label)
            =
            drv::make_menu_item_with_mnemonic (session.subsession, mnemonic_label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_first_radio_button (session: Session)
            =
            drv::make_first_radio_button  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_next_radio_button (session: Session, sib)
            =
            drv::make_next_radio_button (session.subsession, sib);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_first_radio_button_with_label (session: Session, label)
            =
            drv::make_first_radio_button_with_label (session.subsession, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_next_radio_button_with_label (session: Session, sib, label)
            =
            drv::make_next_radio_button_with_label (session.subsession, sib, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_first_radio_button_with_mnemonic (session: Session, label)
            =
            drv::make_first_radio_button_with_mnemonic (session.subsession, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_next_radio_button_with_mnemonic (session: Session, sib, label)
            =
            drv::make_next_radio_button_with_mnemonic (session.subsession, sib, label);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.

        #

         fun make_arrow (session: Session, arrow_direction, shadow_style)
             =
             drv::make_arrow (session.subsession, arrow_direction_to_int arrow_direction, shadow_style_to_int shadow_style);
            
            # Above function handgenerated via write_gtk_pkg_plain_fun.

        #

        fun set_arrow (session: Session, arrow, arrow_direction, shadow_style)
            =
            drv::set_arrow (session.subsession, arrow, arrow_direction_to_int arrow_direction, shadow_style_to_int shadow_style);
            
            # Above function handgenerated via write_gtk_pkg_plain_fun.


        #
        fun make_horizontal_box (session: Session, homogeneous, spacing)
            =
            drv::make_horizontal_box (session.subsession, homogeneous, spacing);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_vertical_box (session: Session, homogeneous, spacing)
            =
            drv::make_vertical_box (session.subsession, homogeneous, spacing);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_horizontal_button_box (session: Session)
            =
            drv::make_horizontal_button_box  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_vertical_button_box (session: Session)
            =
            drv::make_vertical_button_box  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_table { session: Session, rows, cols, homogeneous }
            =
            drv::make_table (session.subsession, rows, cols, homogeneous);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_event_box (session: Session)
            =
            drv::make_event_box  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_image_from_file (session: Session, filename)
            =
            drv::make_image_from_file (session.subsession, filename);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_horizontal_separator (session: Session)
            =
            drv::make_horizontal_separator  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_vertical_separator (session: Session)
            =
            drv::make_vertical_separator  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_layout_container (session: Session)
            =
            drv::make_layout_container  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun layout_put { session: Session, layout, kid, x, y }
            =
            drv::layout_put (session.subsession, layout, kid, x, y);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun layout_move { session: Session, layout, kid, x, y }
            =
            drv::layout_move (session.subsession, layout, kid, x, y);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_fixed_container (session: Session)
            =
            drv::make_fixed_container  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun fixed_put { session: Session, layout, kid, x, y }
            =
            drv::fixed_put (session.subsession, layout, kid, x, y);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun fixed_move { session: Session, layout, kid, x, y }
            =
            drv::fixed_move (session.subsession, layout, kid, x, y);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_adjustment { session: Session, value, lower, upper, step_increment, page_increment, page_size }
            =
            drv::make_adjustment (session.subsession, value, lower, upper, step_increment, page_increment, page_size);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_viewport { session: Session, horizontal_adjustment, vertical_adjustment }
            =
            drv::make_viewport (session.subsession, null_or_widget_to_int horizontal_adjustment, null_or_widget_to_int vertical_adjustment);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_scrolled_window { session: Session, horizontal_adjustment, vertical_adjustment }
            =
            drv::make_scrolled_window (session.subsession, null_or_widget_to_int horizontal_adjustment, null_or_widget_to_int vertical_adjustment);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_horizontal_ruler (session: Session)
            =
            drv::make_horizontal_ruler  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_vertical_ruler (session: Session)
            =
            drv::make_vertical_ruler  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_vertical_scrollbar (session: Session, adjustment)
            =
            drv::make_vertical_scrollbar (session.subsession, null_or_widget_to_int adjustment);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_horizontal_scrollbar (session: Session, adjustment)
            =
            drv::make_horizontal_scrollbar (session.subsession, null_or_widget_to_int adjustment);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_vertical_scale (session: Session, adjustment)
            =
            drv::make_vertical_scale (session.subsession, null_or_widget_to_int adjustment);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_horizontal_scale (session: Session, adjustment)
            =
            drv::make_horizontal_scale (session.subsession, null_or_widget_to_int adjustment);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_vertical_scale_with_range { session: Session, min, max, step }
            =
            drv::make_vertical_scale_with_range (session.subsession, min, max, step);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_horizontal_scale_with_range { session: Session, min, max, step }
            =
            drv::make_horizontal_scale_with_range (session.subsession, min, max, step);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_drawing_area (session: Session)
            =
            drv::make_drawing_area  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_pixmap { session: Session, window, wide, high }
            =
            drv::make_pixmap (session.subsession, window, wide, high);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun make_status_bar (session: Session)
            =
            drv::make_status_bar  session.subsession;
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun push_text_on_status_bar (session: Session, status_bar, context, text)
            =
            drv::push_text_on_status_bar (session.subsession, status_bar, context, text);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun pop_text_off_status_bar (session: Session, status_bar, context)
            =
            drv::pop_text_off_status_bar (session.subsession, status_bar, context);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun remove_text_from_status_bar { session: Session, status_bar, context, message }
            =
            drv::remove_text_from_status_bar (session.subsession, status_bar, context, message);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun pack_box { session: Session, box, kid, pack, expand, fill, padding }
            =
            drv::pack_box (session.subsession, box, kid, pack_to_int pack, expand, fill, padding);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun menu_shell_append { session: Session, menu, kid }
            =
            drv::menu_shell_append (session.subsession, menu, kid);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun menu_bar_append { session: Session, menu, kid }
            =
            drv::menu_bar_append (session.subsession, menu, kid);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun append_text_to_combo_box (session: Session, combo_box, text)
            =
            drv::append_text_to_combo_box (session.subsession, combo_box, text);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_option_menu_menu { session: Session, option_menu, menu }
            =
            drv::set_option_menu_menu (session.subsession, option_menu, menu);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_text_tooltip_on_widget (session: Session, widget, text)
            =
            drv::set_text_tooltip_on_widget (session.subsession, widget, text);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_ruler_metric (session: Session, ruler, metric)
            =
            drv::set_ruler_metric (session.subsession, ruler, metric_to_int metric);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_ruler_range { session: Session, ruler, lower, upper, position, max_size }
            =
            drv::set_ruler_range (session.subsession, ruler, lower, upper, position, max_size);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_scrollbar_policy { session: Session, window, horizontal_scrollbar, vertical_scrollbar }
            =
            drv::set_scrollbar_policy (session.subsession, window, scrollbar_policy_to_int horizontal_scrollbar, scrollbar_policy_to_int vertical_scrollbar);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun draw_rectangle { session: Session, drawable, gcontext, filled, x, y, wide, high }
            =
            drv::draw_rectangle (session.subsession, drawable, gcontext, filled, x, y, wide, high);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun draw_drawable { session: Session, drawable, gcontext, from, from_x, from_y, to_x, to_y, wide, high }
            =
            drv::draw_drawable (session.subsession, drawable, gcontext, from, from_x, from_y, to_x, to_y, wide, high);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun queue_redraw { session: Session, widget, x, y, wide, high }
            =
            drv::queue_redraw (session.subsession, widget, x, y, wide, high);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun press_button (session: Session, widget)
            =
            drv::press_button (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun release_button (session: Session, widget)
            =
            drv::release_button (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun click_button (session: Session, widget)
            =
            drv::click_button (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun enter_button (session: Session, widget)
            =
            drv::enter_button (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun leave_button (session: Session, widget)
            =
            drv::leave_button (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun show_widget (session: Session, widget)
            =
            drv::show_widget (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun show_widget_tree (session: Session, widget)
            =
            drv::show_widget_tree (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun destroy_widget (session: Session, widget)
            =
            drv::destroy_widget (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun emit_changed_signal (session: Session, widget)
            =
            drv::emit_changed_signal (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun pop_up_combo_box (session: Session, widget)
            =
            drv::pop_up_combo_box (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun pop_down_combo_box (session: Session, widget)
            =
            drv::pop_down_combo_box (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_combo_box_title (session: Session, widget, title)
            =
            drv::set_combo_box_title (session.subsession, widget, title);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_window_title (session: Session, window, title)
            =
            drv::set_window_title (session.subsession, window, title);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.

        #
        fun set_window_default_size (session: Session, widget, (wide, high))
            =
            drv::set_window_default_size (session.subsession, widget, wide, high);
            
            # Above function handgenerated via write_gtk_pkg_plain_fun.

        #
        fun set_minimum_widget_size (session: Session, widget, (wide, high))
            =
            drv::set_minimum_widget_size (session.subsession, widget, wide, high);
            
            # Above function handgenerated via write_gtk_pkg_plain_fun.


        #
        fun set_border_width (session: Session, widget, width)
            =
            drv::set_border_width (session.subsession, widget, width);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_event_box_visibility (session: Session, event_box, visibility)
            =
            drv::set_event_box_visibility (session.subsession, event_box, visibility);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_widget_alignment { session: Session, widget, x, y }
            =
            drv::set_widget_alignment (session.subsession, widget, x, y);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_widget_events (session: Session, widget, events)
            =
            drv::set_widget_events (session.subsession, widget, events_to_int events);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_widget_name (session: Session, widget, name)
            =
            drv::set_widget_name (session.subsession, widget, name);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_label_justification (session: Session, label, justification)
            =
            drv::set_label_justification (session.subsession, label, justification_to_int justification);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_label_line_wrapping (session: Session, label, wrap_lines)
            =
            drv::set_label_line_wrapping (session.subsession, label, wrap_lines);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_label_underlines (session: Session, label, underlines)
            =
            drv::set_label_underlines (session.subsession, label, underlines);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_scale_value_position (session: Session, scale, position)
            =
            drv::set_scale_value_position (session.subsession, scale, position_to_int position);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_draw_scale_value (session: Session, scale, draw_value)
            =
            drv::set_draw_scale_value (session.subsession, scale, draw_value);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_scale_value_digits_shown (session: Session, scale)
            =
            drv::get_scale_value_digits_shown (session.subsession, scale);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_scale_value_digits_shown (session: Session, scale, digits)
            =
            drv::set_scale_value_digits_shown (session.subsession, scale, digits);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_range_update_policy (session: Session, scale, policy)
            =
            drv::set_range_update_policy (session.subsession, scale, update_policy_to_int policy);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_toggle_button_state (session: Session, toggle_button)
            =
            drv::get_toggle_button_state (session.subsession, toggle_button);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_toggle_button_state (session: Session, toggle_button, state)
            =
            drv::set_toggle_button_state (session.subsession, toggle_button, state);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_adjustment_value (session: Session, adjustment)
            =
            drv::get_adjustment_value (session.subsession, adjustment);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_adjustment_value (session: Session, adjustment, value)
            =
            drv::set_adjustment_value (session.subsession, adjustment, value);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_white_graphics_context (session: Session, widget)
            =
            drv::get_white_graphics_context (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_black_graphics_context (session: Session, widget)
            =
            drv::get_black_graphics_context (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_current_foreground_graphics_context (session: Session, widget)
            =
            drv::get_current_foreground_graphics_context (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_current_background_graphics_context (session: Session, widget)
            =
            drv::get_current_background_graphics_context (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_widget_window (session: Session, widget)
            =
            drv::get_widget_window (session.subsession, widget);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun add_kid { session: Session, mom, kid }
            =
            drv::add_kid (session.subsession, mom, kid);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun add_scrolled_window_kid { session: Session, window, kid }
            =
            drv::add_scrolled_window_kid (session.subsession, window, kid);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun add_table_kid { session: Session, table, kid, left, right, top, bottom }
            =
            drv::add_table_kid (session.subsession, table, kid, left, right, top, bottom);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun add_table_kid' { session: Session, table, kid, left, right, top, bottom, xoptions, yoptions, xpadding, ypadding }
            =
            drv::add_table_kid2 (session.subsession, table, kid, left, right, top, bottom, sum_table_attach_options xoptions, sum_table_attach_options yoptions, xpadding, ypadding);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_viewport_vertical_adjustment (session: Session, viewport)
            =
            drv::get_viewport_vertical_adjustment (session.subsession, viewport);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun get_viewport_horizontal_adjustment (session: Session, viewport)
            =
            drv::get_viewport_horizontal_adjustment (session.subsession, viewport);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_table_row_spacing { session: Session, table, row, spacing }
            =
            drv::set_table_row_spacing (session.subsession, table, row, spacing);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_table_col_spacing { session: Session, table, col, spacing }
            =
            drv::set_table_col_spacing (session.subsession, table, col, spacing);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_table_row_spacings (session: Session, table, spacing)
            =
            drv::set_table_row_spacings (session.subsession, table, spacing);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.


        #
        fun set_table_col_spacings (session: Session, table, spacing)
            =
            drv::set_table_col_spacings (session.subsession, table, spacing);
            
            # Above function autogenerated by write_gtk_pkg_plain_fun.

        #
        fun note_void_callback (session: Session, callback, callback_id)
            =
            session.void_callback_map
                :=
                int_map::set (*session.void_callback_map, callback_id, callback);


        #
        fun note_bool_callback (session: Session, bool_callback, callback_id)
            =
            session.bool_callback_map
                :=
                int_map::set (*session.bool_callback_map, callback_id, bool_callback);


        #
        fun note_float_callback (session: Session, float_callback, callback_id)
            =
            session.float_callback_map
                :=
                int_map::set (*session.float_callback_map, callback_id, float_callback);


        #
        fun note_button_event_callback (session: Session, button_callback, callback_id)
            =
            session.button_event_callback_map
                :=
                int_map::set (*session.button_event_callback_map, callback_id, button_callback);


        #
        fun note_motion_event_callback (session: Session, motion_callback, callback_id)
            =
            session.motion_event_callback_map
                :=
                int_map::set (*session.motion_event_callback_map, callback_id, motion_callback);


        #
        fun note_key_event_callback (session: Session, key_callback, callback_id)
            =
            session.key_event_callback_map
                :=
                int_map::set (*session.key_event_callback_map, callback_id, key_callback);


        #
        fun note_expose_event_callback (session: Session, expose_callback, callback_id)
            =
            session.expose_event_callback_map
                :=
                int_map::set (*session.expose_event_callback_map, callback_id, expose_callback);


        #
        fun note_configure_event_callback (session: Session, configure_callback, callback_id)
            =
            session.configure_event_callback_map
                :=
                int_map::set (*session.configure_event_callback_map, callback_id, configure_callback);


 
 
    # Respectively set handler
    # for event "clicked",
    # "pressed", "released",
    # "enter", "leave",
    # "activate", "toggled"
    # or "value_changed" :
    #
    # Here "s w c" == "session widget callback":
    #
    fun set_clicked_callback                 s w c = note_void_callback           (s, c, drv::set_clicked_callback                 (s.subsession, w));  # Handle 'clicked' signal
    fun set_pressed_callback                 s w c = note_void_callback           (s, c, drv::set_pressed_callback                 (s.subsession, w));  # Handle 'pressed' signal
    fun set_release_callback                 s w c = note_void_callback           (s, c, drv::set_release_callback                 (s.subsession, w));  # Handle 'release' signal
    fun set_enter_callback                   s w c = note_void_callback           (s, c, drv::set_enter_callback                   (s.subsession, w));  # Handle 'enter' signal
    fun set_leave_callback                   s w c = note_void_callback           (s, c, drv::set_leave_callback                   (s.subsession, w));  # Handle 'leave' signal
    fun set_activate_callback                s w c = note_void_callback           (s, c, drv::set_activate_callback                (s.subsession, w));  # Handle 'activate' signal
    fun set_destroy_callback                 s w c = note_void_callback           (s, c, drv::set_destroy_callback                 (s.subsession, w));  # Handle 'destroy' signal
    fun set_realize_callback                 s w c = note_void_callback           (s, c, drv::set_realize_callback                 (s.subsession, w));  # Handle 'realize' signal
 
 
    # Handlers for X events :           http://library.gnome.org/devel/gtk-tutorial/stable/x182.html
    #
    fun set_button_press_event_callback      s w c = note_button_event_callback   (s, c, drv::set_button_press_event_callback      (s.subsession, w));  # Handle 'button_press_event' signal
    fun set_button_release_event_callback    s w c = note_void_callback           (s, c, drv::set_button_release_event_callback    (s.subsession, w));  # Handle 'button_release_event' signal
    fun set_scroll_event_callback            s w c = note_void_callback           (s, c, drv::set_scroll_event_callback            (s.subsession, w));  # Handle 'scroll_event' signal
    fun set_motion_notify_event_callback     s w c = note_motion_event_callback   (s, c, drv::set_motion_notify_event_callback     (s.subsession, w));  # Handle 'motion_notify_event' signal
    fun set_delete_event_callback            s w c = note_void_callback           (s, c, drv::set_delete_event_callback            (s.subsession, w));  # Handle 'delete_event' signal
    fun set_expose_event_callback            s w c = note_expose_event_callback   (s, c, drv::set_expose_event_callback            (s.subsession, w));  # Handle 'expose_event' signal
    fun set_key_press_event_callback         s w c = note_key_event_callback      (s, c, drv::set_key_press_event_callback         (s.subsession, w));  # Handle 'key_press_event' signal
    fun set_key_release_event_callback       s w c = note_void_callback           (s, c, drv::set_key_release_event_callback       (s.subsession, w));  # Handle 'key_release_event' signal
    fun set_enter_notify_event_callback      s w c = note_void_callback           (s, c, drv::set_enter_notify_event_callback      (s.subsession, w));  # Handle 'enter_notify_event' signal
    fun set_leave_notify_event_callback      s w c = note_void_callback           (s, c, drv::set_leave_notify_event_callback      (s.subsession, w));  # Handle 'leave_notify_event' signal
    fun set_configure_event_callback         s w c = note_configure_event_callback (s, c, drv::set_configure_event_callback         (s.subsession, w)); # Handle 'configure_event' signal
    fun set_focus_in_event_callback          s w c = note_void_callback           (s, c, drv::set_focus_in_event_callback          (s.subsession, w));  # Handle 'focus_in_event' signal
    fun set_focus_out_event_callback         s w c = note_void_callback           (s, c, drv::set_focus_out_event_callback         (s.subsession, w));  # Handle 'focus_out_event' signal
    fun set_map_event_callback               s w c = note_void_callback           (s, c, drv::set_map_event_callback               (s.subsession, w));  # Handle 'map_event' signal
    fun set_unmap_event_callback             s w c = note_void_callback           (s, c, drv::set_unmap_event_callback             (s.subsession, w));  # Handle 'unmap_event' signal
    fun set_property_notify_event_callback   s w c = note_void_callback           (s, c, drv::set_property_notify_event_callback   (s.subsession, w));  # Handle 'property_notify_event' signal
    fun set_selection_clear_event_callback   s w c = note_void_callback           (s, c, drv::set_selection_clear_event_callback   (s.subsession, w));  # Handle 'selection_clear_event' signal
    fun set_selection_request_event_callback s w c = note_void_callback           (s, c, drv::set_selection_request_event_callback (s.subsession, w));  # Handle 'selection_request_event' signal
    fun set_selection_notify_event_callback  s w c = note_void_callback           (s, c, drv::set_selection_notify_event_callback  (s.subsession, w));  # Handle 'selection_notify_event' signal
    fun set_proximity_in_event_callback      s w c = note_void_callback           (s, c, drv::set_proximity_in_event_callback      (s.subsession, w));  # Handle 'proximity_in_event' signal
    fun set_proximity_out_event_callback     s w c = note_void_callback           (s, c, drv::set_proximity_out_event_callback     (s.subsession, w));  # Handle 'proximity_out_event' signal
    fun set_client_event_callback            s w c = note_void_callback           (s, c, drv::set_client_event_callback            (s.subsession, w));  # Handle 'client_event' signal
    fun set_no_expose_event_callback         s w c = note_void_callback           (s, c, drv::set_no_expose_event_callback         (s.subsession, w));  # Handle 'no_expose_event' signal
    fun set_window_state_event_callback      s w c = note_void_callback           (s, c, drv::set_window_state_event_callback      (s.subsession, w));  # Handle 'window_state_event' signal
 
    # Callbacks taking a boolean argument:
    #
    fun set_toggled_callback                 s w c = note_bool_callback           (s, c, drv::set_toggled_callback                 (s.subsession, w));  # Handle 'toggled' signal
 
    # Callbacks taking a boolean argument:
    #
    fun set_value_changed_callback           s w c = note_float_callback          (s, c, drv::set_value_changed_callback           (s.subsession, w));  # Handle 'value_changed' signal
# Do not edit this or preceding lines -- they are autogenerated by make-gtk-glue.

        #
        fun get_widget_allocation (session: Session, widget)
            =
            {   my (x, y, wide, high)
                    =
                    drv::get_widget_allocation (session.subsession, widget);

                { x, y, wide, high };
            };

        #
        fun get_window_pointer (session: Session, window)
            =
            {   my (x, y, modifiers)
                    =
                    drv::get_window_pointer (session.subsession, window); 

                { x, y, modifiers => int_to_modifier_list modifiers };
            };

        #
        fun make_dialog (session: Session)
            =
            {   my (dialog, vbox, action_area)
                    = 
                    drv::make_dialog  session.subsession;

                { dialog, vbox, action_area };
            };

        #
        fun set_widget_tree  (session: Session,  widget)
            =
            session.widget_tree := widget;

        #
        fun quit_eventloop  (session: Session)
            =
            drv::quit_eventloop  session.subsession;

        fun unref_object (session: Session, widget)
            =
            drv::unref_object (session.subsession, widget);

    end;

    stipulate
        include eight_byte_float;
    herein
        fun clamp { min, max, value }
            =
            if   (value < min)   min;
            elif (value > max)   max;
            else                 value;
            fi;
    end;
};




Comments and suggestions to: bugs@mythryl.org

PreviousUpNext