PreviousUpNext

15.4.1679  src/lib/x-kit/xclient/src/wire/value-to-wire.pkg

## value-to-wire.pkg
#

# Compiled by:
#     src/lib/x-kit/xclient/xclient-internals.sublib


stipulate
    package fil =  file__premicrothread;                # file__premicrothread  is from   src/lib/std/src/posix/file--premicrothread.pkg
    package v2w =  value_to_wire_pith;                  # value_to_wire_pith    is from   src/lib/x-kit/xclient/src/wire/value-to-wire-pith.pkg
    package xtr =  xlogger;                             # xlogger               is from   src/lib/x-kit/xclient/src/stuff/xlogger.pkg
    trace       =  xtr::log_if  xtr::io_logging 0;      # Conditionally write strings to tracing.log or whatever.
herein


    package   value_to_wire
    :         Value_To_Wire                             # Value_To_Wire         is from   src/lib/x-kit/xclient/src/wire/value-to-wire.api
    {
        # Convert "abc" -> "61.62.63." etc:
        #
        fun string_to_hex s
            =
            string::translate
                (\\ c =  number_string::pad_left '0' 2 (int::format number_string::HEX (char::to_int c)) + ".")
                 s;

        # As above, starting with byte-vector:
        #
        fun bytes_to_hex  bytes
            =
            string_to_hex (byte::unpack_string_vector(vector_slice_of_one_byte_unts::make_slice (bytes, 0, NULL)));

        fun debug (f, s) x
            =
            {   result = f x;
                trace {. sprintf "value_to_wire::%s: result x=%s" s (bytes_to_hex result); };
                result;
            }
            except ex
                =
                {   fil::print (sprintf "value_to_wire::%s: Uncaught exception %s\n" s (exceptions::exception_name ex) );
                    #
                    trace  {.  sprintf "value_to_wire::%s: Uncaught exception %s\n" s (exceptions::exception_name ex);  };

                    raise exception ex;
                };






        graph_op_to_wire   =  v2w::graph_op_to_wire;
        gravity_to_wire    =  v2w::gravity_to_wire;
        bool_to_wire       =  v2w::bool_to_wire;
        stack_mode_to_wire =  v2w::stack_mode_to_wire;
        do_val_list        =  v2w::do_val_list;

        fun encode_alloc_color                x =  debug (v2w::encode_alloc_color,                "encode_alloc_color"               ) x;
        fun encode_alloc_named_color          x =  debug (v2w::encode_alloc_named_color,          "encode_alloc_named_color"         ) x;
        fun encode_allow_events               x =  debug (v2w::encode_allow_events,               "encode_allow_events"              ) x;
        fun encode_bell                       x =  debug (v2w::encode_bell,                       "encode_bell"                      ) x;
        fun encode_change_active_pointer_grab x =  debug (v2w::encode_change_active_pointer_grab, "encode_change_active_pointer_grab") x;
        fun encode_change_gc                  x =  debug (v2w::encode_change_gc,                  "encode_change_gc"                 ) x;
        fun encode_change_hosts               x =  debug (v2w::encode_change_hosts,               "encode_change_hosts"              ) x;
        fun encode_change_keyboard_control    x =  debug (v2w::encode_change_keyboard_control,    "encode_change_keyboard_control"   ) x;
        fun encode_change_pointer_control     x =  debug (v2w::encode_change_pointer_control,     "encode_change_pointer_control"    ) x;
        fun encode_change_property            x =  debug (v2w::encode_change_property,            "encode_change_property"           ) x;
        fun encode_change_save_set            x =  debug (v2w::encode_change_save_set,            "encode_change_save_set"           ) x;
        fun encode_change_window_attributes   x =  debug (v2w::encode_change_window_attributes,   "encode_change_window_attributes"  ) x;
        fun encode_circulate_window           x =  debug (v2w::encode_circulate_window,           "encode_circulate_window"          ) x;
        fun encode_clear_area                 x =  debug (v2w::encode_clear_area,                 "encode_clear_area"                ) x;
        fun encode_close_font                 x =  debug (v2w::encode_close_font,                 "encode_close_font"                ) x;
        fun encode_configure_window           x =  debug (v2w::encode_configure_window,           "encode_configure_window"          ) x;
        fun encode_xserver_connection_request x =  debug (v2w::encode_xserver_connection_request, "encode_xserver_connection_request") x;
        fun encode_convert_selection          x =  debug (v2w::encode_convert_selection,          "encode_convert_selection"         ) x;
        fun encode_copy_area                  x =  debug (v2w::encode_copy_area,                  "encode_copy_area"                 ) x;
        fun encode_copy_colormap_and_free     x =  debug (v2w::encode_copy_colormap_and_free,     "encode_copy_colormap_and_free"    ) x;
        fun encode_copy_gc                    x =  debug (v2w::encode_copy_gc,                    "encode_copy_gc"                   ) x;
        fun encode_copy_plane                 x =  debug (v2w::encode_copy_plane,                 "encode_copy_plane"                ) x;
        fun encode_create_colormap            x =  debug (v2w::encode_create_colormap,            "encode_create_colormap"           ) x;
        fun encode_create_cursor              x =  debug (v2w::encode_create_cursor,              "encode_create_cursor"             ) x;
        fun encode_create_gc                  x =  debug (v2w::encode_create_gc,                  "encode_create_gc"                 ) x;
        fun encode_create_glyph_cursor        x =  debug (v2w::encode_create_glyph_cursor,        "encode_create_glyph_cursor"       ) x;
        fun encode_create_pixmap              x =  debug (v2w::encode_create_pixmap,              "encode_create_pixmap"             ) x;
        fun encode_create_window              x =  debug (v2w::encode_create_window,              "encode_create_window"             ) x;
        fun encode_delete_property            x =  debug (v2w::encode_delete_property,            "encode_delete_property"           ) x;
        fun encode_destroy_subwindows         x =  debug (v2w::encode_destroy_subwindows,         "encode_destroy_subwindows"        ) x;
        fun encode_destroy_window             x =  debug (v2w::encode_destroy_window,             "encode_destroy_window"            ) x;
        fun encode_fill_poly                  x =  debug (v2w::encode_fill_poly,                  "encode_fill_poly"                 ) x;
        fun encode_force_screen_saver         x =  debug (v2w::encode_force_screen_saver,         "encode_force_screen_saver"        ) x;
        fun encode_free_colormap              x =  debug (v2w::encode_free_colormap,              "encode_free_colormap"             ) x;
        fun encode_free_colors                x =  debug (v2w::encode_free_colors,                "encode_free_colors"               ) x;
        fun encode_free_cursor                x =  debug (v2w::encode_free_cursor,                "encode_free_cursor"               ) x;
        fun encode_free_gc                    x =  debug (v2w::encode_free_gc,                    "encode_free_gc"                   ) x;
        fun encode_free_pixmap                x =  debug (v2w::encode_free_pixmap,                "encode_free_pixmap"               ) x;
        fun encode_get_atom_name              x =  debug (v2w::encode_get_atom_name,              "encode_get_atom_name"             ) x;
        fun encode_get_geometry               x =  debug (v2w::encode_get_geometry,               "encode_get_geometry"              ) x;
        fun encode_get_image                  x =  debug (v2w::encode_get_image,                  "encode_get_image"                 ) x;
        fun encode_get_keyboard_mapping       x =  debug (v2w::encode_get_keyboard_mapping,       "encode_get_keyboard_mapping"      ) x;
        fun encode_get_motion_events          x =  debug (v2w::encode_get_motion_events,          "encode_get_motion_events"         ) x;
        fun encode_get_property               x =  debug (v2w::encode_get_property,               "encode_get_property"              ) x;
        fun encode_get_selection_owner        x =  debug (v2w::encode_get_selection_owner,        "encode_get_selection_owner"       ) x;
        fun encode_get_window_attributes      x =  debug (v2w::encode_get_window_attributes,      "encode_get_window_attributes"     ) x;
        fun encode_grab_button                x =  debug (v2w::encode_grab_button,                "encode_grab_button"               ) x;
        fun encode_grab_key                   x =  debug (v2w::encode_grab_key,                   "encode_grab_key"                  ) x;
        fun encode_grab_keyboard              x =  debug (v2w::encode_grab_keyboard,              "encode_grab_keyboard"             ) x;
        fun encode_grab_pointer               x =  debug (v2w::encode_grab_pointer,               "encode_grab_pointer"              ) x;
        fun encode_image_text16               x =  debug (v2w::encode_image_text16,               "encode_image_text16"              ) x;
        fun encode_image_text8                x =  debug (v2w::encode_image_text8,                "encode_image_text8"               ) x;
        fun encode_install_colormap           x =  debug (v2w::encode_install_colormap,           "encode_install_colormap"          ) x;
        fun encode_intern_atom                x =  debug (v2w::encode_intern_atom,                "encode_intern_atom"               ) x;
        fun encode_kill_client                x =  debug (v2w::encode_kill_client,                "encode_kill_client"               ) x;
        fun encode_list_fonts                 x =  debug (v2w::encode_list_fonts,                 "encode_list_fonts"                ) x;
        fun encode_list_fonts_with_info       x =  debug (v2w::encode_list_fonts_with_info,       "encode_list_fonts_with_info"      ) x;
        fun encode_list_installed_colormaps   x =  debug (v2w::encode_list_installed_colormaps,   "encode_list_installed_colormaps"  ) x;
        fun encode_list_properties            x =  debug (v2w::encode_list_properties,            "encode_list_properties"           ) x;
        fun encode_lookup_color               x =  debug (v2w::encode_lookup_color,               "encode_lookup_color"              ) x;
        fun encode_map_subwindows             x =  debug (v2w::encode_map_subwindows,             "encode_map_subwindows"            ) x;
        fun encode_map_window                 x =  debug (v2w::encode_map_window,                 "encode_map_window"                ) x;
        fun encode_open_font                  x =  debug (v2w::encode_open_font,                  "encode_open_font"                 ) x;
        fun encode_poly_arc                   x =  debug (v2w::encode_poly_arc,                   "encode_poly_arc"                  ) x;
        fun encode_poly_box                   x =  debug (v2w::encode_poly_box,                   "encode_poly_box"                  ) x;
        fun encode_poly_fill_arc              x =  debug (v2w::encode_poly_fill_arc,              "encode_poly_fill_arc"             ) x;
        fun encode_poly_fill_box              x =  debug (v2w::encode_poly_fill_box,              "encode_poly_fill_box"             ) x;
        fun encode_poly_line                  x =  debug (v2w::encode_poly_line,                  "encode_poly_line"                 ) x;
        fun encode_poly_point                 x =  debug (v2w::encode_poly_point,                 "encode_poly_point"                ) x;
        fun encode_poly_segment               x =  debug (v2w::encode_poly_segment,               "encode_poly_segment"              ) x;
        fun encode_poly_text16                x =  debug (v2w::encode_poly_text16,                "encode_poly_text16"               ) x;
        fun encode_poly_text8                 x =  debug (v2w::encode_poly_text8,                 "encode_poly_text8"                ) x;
        fun encode_push_event                 x =  debug (v2w::encode_push_event,                 "encode_push_event"                ) x;
        fun encode_put_image                  x =  debug (v2w::encode_put_image,                  "encode_put_image"                 ) x;
        fun encode_query_best_size            x =  debug (v2w::encode_query_best_size,            "encode_query_best_size"           ) x;
        fun encode_query_colors               x =  debug (v2w::encode_query_colors,               "encode_query_colors"              ) x;
        fun encode_query_extension            x =  debug (v2w::encode_query_extension,            "encode_query_extension"           ) x;
        fun encode_query_font                 x =  debug (v2w::encode_query_font,                 "encode_query_font"                ) x;
        fun encode_query_pointer              x =  debug (v2w::encode_query_pointer,              "encode_query_pointer"             ) x;
        fun encode_query_text_extents         x =  debug (v2w::encode_query_text_extents,         "encode_query_text_extents"        ) x;
        fun encode_query_tree                 x =  debug (v2w::encode_query_tree,                 "encode_query_tree"                ) x;
        fun encode_recolor_cursor             x =  debug (v2w::encode_recolor_cursor,             "encode_recolor_cursor"            ) x;
        fun encode_reparent_window            x =  debug (v2w::encode_reparent_window,            "encode_reparent_window"           ) x;
        fun encode_rotate_properties          x =  debug (v2w::encode_rotate_properties,          "encode_rotate_properties"         ) x;
        fun encode_set_access_control         x =  debug (v2w::encode_set_access_control,         "encode_set_access_control"        ) x;
        fun encode_set_clip_boxes             x =  debug (v2w::encode_set_clip_boxes,             "encode_set_clip_boxes"            ) x;
        fun encode_set_close_down_mode        x =  debug (v2w::encode_set_close_down_mode,        "encode_set_close_down_mode"       ) x;
        fun encode_set_dashes                 x =  debug (v2w::encode_set_dashes,                 "encode_set_dashes"                ) x;
        fun encode_set_font_path              x =  debug (v2w::encode_set_font_path,              "encode_set_font_path"             ) x;
        fun encode_set_input_focus            x =  debug (v2w::encode_set_input_focus,            "encode_set_input_focus"           ) x;
        fun encode_set_screen_saver           x =  debug (v2w::encode_set_screen_saver,           "encode_set_screen_saver"          ) x;
        fun encode_set_selection_owner        x =  debug (v2w::encode_set_selection_owner,        "encode_set_selection_owner"       ) x;
        fun encode_store_colors               x =  debug (v2w::encode_store_colors,               "encode_store_colors"              ) x;
        fun encode_store_named_color          x =  debug (v2w::encode_store_named_color,          "encode_store_named_color"         ) x;
        fun encode_translate_coordinates      x =  debug (v2w::encode_translate_coordinates,      "encode_translate_coordinates"     ) x;
        fun encode_ungrab_button              x =  debug (v2w::encode_ungrab_button,              "encode_ungrab_button"             ) x;
        fun encode_ungrab_key                 x =  debug (v2w::encode_ungrab_key,                 "encode_ungrab_key"                ) x;
        fun encode_ungrab_keyboard            x =  debug (v2w::encode_ungrab_keyboard,            "encode_ungrab_keyboard"           ) x;
        fun encode_ungrab_pointer             x =  debug (v2w::encode_ungrab_pointer,             "encode_ungrab_pointer"            ) x;
        fun encode_uninstall_colormap         x =  debug (v2w::encode_uninstall_colormap,         "encode_uninstall_colormap"        ) x;
        fun encode_unmap_subwindows           x =  debug (v2w::encode_unmap_subwindows,           "encode_unmap_subwindows"          ) x;
        fun encode_unmap_window               x =  debug (v2w::encode_unmap_window,               "encode_unmap_window"              ) x;
        fun encode_warp_pointer               x =  debug (v2w::encode_warp_pointer,               "encode_warp_pointer"              ) x;

        request_get_font_path        = v2w::request_get_font_path;
        request_get_input_focus      = v2w::request_get_input_focus;
        request_get_keyboard_control = v2w::request_get_keyboard_control;
        request_get_modifier_mapping = v2w::request_get_modifier_mapping;
        request_get_pointer_control  = v2w::request_get_pointer_control;
        request_get_screen_saver     = v2w::request_get_screen_saver;
        request_grab_server          = v2w::request_grab_server;
        request_list_extensions      = v2w::request_list_extensions;
        request_list_hosts           = v2w::request_list_hosts;
        request_no_operation         = v2w::request_no_operation;
        request_query_keymap         = v2w::request_query_keymap;
        request_ungrab_server        = v2w::request_ungrab_server;

    };                                                                          # package value_to_wire
end;






Comments and suggestions to: bugs@mythryl.org

PreviousUpNext