## exercise-x-appwindow.pkg
#
# A little package to de-clutter
#
#
src/lib/x-kit/widget/xkit/app/guishim-imp-for-x.pkg#
# by moving this fn out of it.
# Compiled by:
#
src/lib/x-kit/widget/xkit-widget.sublibstipulate
include package threadkit; # threadkit is from
src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg #
# package ap = client_to_atom; # client_to_atom is from
src/lib/x-kit/xclient/src/iccc/client-to-atom.pkg package au = authentication; # authentication is from
src/lib/x-kit/xclient/src/stuff/authentication.pkg# package gtg = guiboss_to_guishim; # guiboss_to_guishim is from
src/lib/x-kit/widget/theme/guiboss-to-guishim.pkg# package cpm = cs_pixmap; # cs_pixmap is from
src/lib/x-kit/xclient/src/window/cs-pixmap.pkg package cpt = cs_pixmat; # cs_pixmat is from
src/lib/x-kit/xclient/src/window/cs-pixmat.pkg package dy = display; # display is from
src/lib/x-kit/xclient/src/wire/display.pkg# package xet = xevent_types; # xevent_types is from
src/lib/x-kit/xclient/src/wire/xevent-types.pkg# package w2x = windowsystem_to_xserver; # windowsystem_to_xserver is from
src/lib/x-kit/xclient/src/window/windowsystem-to-xserver.pkg# package fil = file__premicrothread; # file__premicrothread is from
src/lib/std/src/posix/file--premicrothread.pkg package fti = font_index; # font_index is from
src/lib/x-kit/xclient/src/window/font-index.pkg package iui = issue_unique_id; # issue_unique_id is from
src/lib/src/issue-unique-id.pkg# package r2k = xevent_router_to_keymap; # xevent_router_to_keymap is from
src/lib/x-kit/xclient/src/window/xevent-router-to-keymap.pkg package mtx = rw_matrix; # rw_matrix is from
src/lib/std/src/rw-matrix.pkg package r8 = rgb8; # rgb8 is from
src/lib/x-kit/xclient/src/color/rgb8.pkg# package rgb = rgb; # rgb is from
src/lib/x-kit/xclient/src/color/rgb.pkg package rop = ro_pixmap; # ro_pixmap is from
src/lib/x-kit/xclient/src/window/ro-pixmap.pkg package rw = root_window; # root_window is from
src/lib/x-kit/widget/lib/root-window.pkg# package rwv = rw_vector; # rw_vector is from
src/lib/std/src/rw-vector.pkg package sep = client_to_selection; # client_to_selection is from
src/lib/x-kit/xclient/src/window/client-to-selection.pkg package shp = shade; # shade is from
src/lib/x-kit/widget/lib/shade.pkg package sj = socket_junk; # socket_junk is from
src/lib/internet/socket-junk.pkg# package x2s = xclient_to_sequencer; # xclient_to_sequencer is from
src/lib/x-kit/xclient/src/wire/xclient-to-sequencer.pkg# package tr = logger; # logger is from
src/lib/src/lib/thread-kit/src/lib/logger.pkg# package tsr = thread_scheduler_is_running; # thread_scheduler_is_running is from
src/lib/src/lib/thread-kit/src/core-thread-kit/thread-scheduler-is-running.pkg# package u1 = one_byte_unt; # one_byte_unt is from
src/lib/std/one-byte-unt.pkg# package v1u = vector_of_one_byte_unts; # vector_of_one_byte_unts is from
src/lib/std/src/vector-of-one-byte-unts.pkg package v2w = value_to_wire; # value_to_wire is from
src/lib/x-kit/xclient/src/wire/value-to-wire.pkg# package wg = widget; # widget is from
src/lib/x-kit/widget/old/basic/widget.pkg package wi = window; # window is from
src/lib/x-kit/xclient/src/window/window.pkg package wme = window_map_event_sink; # window_map_event_sink is from
src/lib/x-kit/xclient/src/window/window-map-event-sink.pkg package wpp = client_to_window_watcher; # client_to_window_watcher is from
src/lib/x-kit/xclient/src/window/client-to-window-watcher.pkg package wy = widget_style; # widget_style is from
src/lib/x-kit/widget/lib/widget-style.pkg# package e2s = xevent_to_string; # xevent_to_string is from
src/lib/x-kit/xclient/src/to-string/xevent-to-string.pkg# package xc = xclient; # xclient is from
src/lib/x-kit/xclient/xclient.pkg package g2d = geometry2d; # geometry2d is from
src/lib/std/2d/geometry2d.pkg package xj = xsession_junk; # xsession_junk is from
src/lib/x-kit/xclient/src/window/xsession-junk.pkg package xt = xtypes; # xtypes is from
src/lib/x-kit/xclient/src/wire/xtypes.pkg# package xtr = xlogger; # xlogger is from
src/lib/x-kit/xclient/src/stuff/xlogger.pkg #
tracefile = "widget-unit-test.trace.log";
herein
package exercise_x_appwindow
{
fun exercise_x_appwindow (window: xj::Window)
=
{ mblack = mtx::make_rw_matrix ((10,10), r8::rgb8_black );
#
mred = mtx::make_rw_matrix ((10,10), r8::rgb8_red );
mgreen = mtx::make_rw_matrix ((10,10), r8::rgb8_green );
mblue = mtx::make_rw_matrix ((10,10), r8::rgb8_blue );
#
mcyan = mtx::make_rw_matrix ((10,10), r8::rgb8_cyan );
mmagenta = mtx::make_rw_matrix ((10,10), r8::rgb8_magenta );
myellow = mtx::make_rw_matrix ((10,10), r8::rgb8_yellow );
#
mwhite = mtx::make_rw_matrix ((10,10), r8::rgb8_white );
#
fun to_x dest pixmat # Dest is something like { col => 140, row => 20 }
=
cpt::copy_from_clientside_pixmat_to_pixmap
#
window
#
{ from => pixmat,
#
from_box => { col => 0, wide => 9,
row => 0, high => 9
},
to_point => dest
};
# fun from_x ()
# =
# cpt::make_clientside_pixmat_from_window (window_area_to_sample, window);
# printf "guishim-imp-for-x.pkg sleeping for 2 seconds before doing 100 updates...\n";
# sleep_for 2.0;
matrices = [ mblack, mred, mgreen, mblue, mcyan, mmagenta, myellow, mwhite ];
for (i = 0, m = matrices; i < 100; ++i) {
#
to_x { col => 0, row => 1 } (list::nth (m, 0));
to_x { col => 0, row => 11 } (list::nth (m, 1));
to_x { col => 0, row => 21 } (list::nth (m, 2));
to_x { col => 0, row => 31 } (list::nth (m, 3));
to_x { col => 0, row => 41 } (list::nth (m, 4));
to_x { col => 0, row => 51 } (list::nth (m, 5));
to_x { col => 0, row => 61 } (list::nth (m, 6));
to_x { col => 0, row => 71 } (list::nth (m, 7));
#
to_x { col => 10, row => 1 } (list::nth (m, 7));
to_x { col => 10, row => 11 } (list::nth (m, 6));
to_x { col => 10, row => 21 } (list::nth (m, 5));
to_x { col => 10, row => 31 } (list::nth (m, 4));
to_x { col => 10, row => 41 } (list::nth (m, 3));
to_x { col => 10, row => 51 } (list::nth (m, 2));
to_x { col => 10, row => 61 } (list::nth (m, 1));
to_x { col => 10, row => 71 } (list::nth (m, 0));
#
to_x { col => 20, row => 1 } (list::nth (m, 0));
to_x { col => 20, row => 11 } (list::nth (m, 1));
to_x { col => 20, row => 21 } (list::nth (m, 2));
to_x { col => 20, row => 31 } (list::nth (m, 3));
to_x { col => 20, row => 41 } (list::nth (m, 4));
to_x { col => 20, row => 51 } (list::nth (m, 5));
to_x { col => 20, row => 61 } (list::nth (m, 6));
to_x { col => 20, row => 71 } (list::nth (m, 7));
#
to_x { col => 30, row => 1 } (list::nth (m, 7));
to_x { col => 30, row => 11 } (list::nth (m, 6));
to_x { col => 30, row => 21 } (list::nth (m, 5));
to_x { col => 30, row => 31 } (list::nth (m, 4));
to_x { col => 30, row => 41 } (list::nth (m, 3));
to_x { col => 30, row => 51 } (list::nth (m, 2));
to_x { col => 30, row => 61 } (list::nth (m, 1));
to_x { col => 30, row => 71 } (list::nth (m, 0));
#
to_x { col => 40, row => 1 } (list::nth (m, 0));
to_x { col => 40, row => 11 } (list::nth (m, 1));
to_x { col => 40, row => 21 } (list::nth (m, 2));
to_x { col => 40, row => 31 } (list::nth (m, 3));
to_x { col => 40, row => 41 } (list::nth (m, 4));
to_x { col => 40, row => 51 } (list::nth (m, 5));
to_x { col => 40, row => 61 } (list::nth (m, 6));
to_x { col => 40, row => 71 } (list::nth (m, 7));
#
to_x { col => 50, row => 1 } (list::nth (m, 7));
to_x { col => 50, row => 11 } (list::nth (m, 6));
to_x { col => 50, row => 21 } (list::nth (m, 5));
to_x { col => 50, row => 31 } (list::nth (m, 4));
to_x { col => 50, row => 41 } (list::nth (m, 3));
to_x { col => 50, row => 51 } (list::nth (m, 2));
to_x { col => 50, row => 61 } (list::nth (m, 1));
to_x { col => 50, row => 71 } (list::nth (m, 0));
#
to_x { col => 60, row => 1 } (list::nth (m, 0));
to_x { col => 60, row => 11 } (list::nth (m, 1));
to_x { col => 60, row => 21 } (list::nth (m, 2));
to_x { col => 60, row => 31 } (list::nth (m, 3));
to_x { col => 60, row => 41 } (list::nth (m, 4));
to_x { col => 60, row => 51 } (list::nth (m, 5));
to_x { col => 60, row => 61 } (list::nth (m, 6));
to_x { col => 60, row => 71 } (list::nth (m, 7));
#
to_x { col => 70, row => 1 } (list::nth (m, 7));
to_x { col => 70, row => 11 } (list::nth (m, 6));
to_x { col => 70, row => 21 } (list::nth (m, 5));
to_x { col => 70, row => 31 } (list::nth (m, 4));
to_x { col => 70, row => 41 } (list::nth (m, 3));
to_x { col => 70, row => 51 } (list::nth (m, 2));
to_x { col => 70, row => 61 } (list::nth (m, 1));
to_x { col => 70, row => 71 } (list::nth (m, 0));
#
to_x { col => 80, row => 1 } (list::nth (m, 0));
to_x { col => 80, row => 11 } (list::nth (m, 1));
to_x { col => 80, row => 21 } (list::nth (m, 2));
to_x { col => 80, row => 31 } (list::nth (m, 3));
to_x { col => 80, row => 41 } (list::nth (m, 4));
to_x { col => 80, row => 51 } (list::nth (m, 5));
to_x { col => 80, row => 61 } (list::nth (m, 6));
to_x { col => 80, row => 71 } (list::nth (m, 7));
#
to_x { col => 90, row => 1 } (list::nth (m, 7));
to_x { col => 90, row => 11 } (list::nth (m, 6));
to_x { col => 90, row => 21 } (list::nth (m, 5));
to_x { col => 90, row => 31 } (list::nth (m, 4));
to_x { col => 90, row => 41 } (list::nth (m, 3));
to_x { col => 90, row => 51 } (list::nth (m, 2));
to_x { col => 90, row => 61 } (list::nth (m, 1));
to_x { col => 90, row => 71 } (list::nth (m, 0));
#
to_x { col => 100, row => 1 } (list::nth (m, 0));
to_x { col => 100, row => 11 } (list::nth (m, 1));
to_x { col => 100, row => 21 } (list::nth (m, 2));
to_x { col => 100, row => 31 } (list::nth (m, 3));
to_x { col => 100, row => 41 } (list::nth (m, 4));
to_x { col => 100, row => 51 } (list::nth (m, 5));
to_x { col => 100, row => 61 } (list::nth (m, 6));
to_x { col => 100, row => 71 } (list::nth (m, 7));
#
to_x { col => 110, row => 1 } (list::nth (m, 7));
to_x { col => 110, row => 11 } (list::nth (m, 6));
to_x { col => 110, row => 21 } (list::nth (m, 5));
to_x { col => 110, row => 31 } (list::nth (m, 4));
to_x { col => 110, row => 41 } (list::nth (m, 3));
to_x { col => 110, row => 51 } (list::nth (m, 2));
to_x { col => 110, row => 61 } (list::nth (m, 1));
to_x { col => 110, row => 71 } (list::nth (m, 0));
#
to_x { col => 120, row => 1 } (list::nth (m, 0));
to_x { col => 120, row => 11 } (list::nth (m, 1));
to_x { col => 120, row => 21 } (list::nth (m, 2));
to_x { col => 120, row => 31 } (list::nth (m, 3));
to_x { col => 120, row => 41 } (list::nth (m, 4));
to_x { col => 120, row => 51 } (list::nth (m, 5));
to_x { col => 120, row => 61 } (list::nth (m, 6));
to_x { col => 120, row => 71 } (list::nth (m, 7));
#
to_x { col => 130, row => 1 } (list::nth (m, 7));
to_x { col => 130, row => 11 } (list::nth (m, 6));
to_x { col => 130, row => 21 } (list::nth (m, 5));
to_x { col => 130, row => 31 } (list::nth (m, 4));
to_x { col => 130, row => 41 } (list::nth (m, 3));
to_x { col => 130, row => 51 } (list::nth (m, 2));
to_x { col => 130, row => 61 } (list::nth (m, 1));
to_x { col => 130, row => 71 } (list::nth (m, 0));
#
to_x { col => 140, row => 1 } (list::nth (m, 0));
to_x { col => 140, row => 11 } (list::nth (m, 1));
to_x { col => 140, row => 21 } (list::nth (m, 2));
to_x { col => 140, row => 31 } (list::nth (m, 3));
to_x { col => 140, row => 41 } (list::nth (m, 4));
to_x { col => 140, row => 51 } (list::nth (m, 5));
to_x { col => 140, row => 61 } (list::nth (m, 6));
to_x { col => 140, row => 71 } (list::nth (m, 7));
#
to_x { col => 150, row => 1 } (list::nth (m, 7));
to_x { col => 150, row => 11 } (list::nth (m, 6));
to_x { col => 150, row => 21 } (list::nth (m, 5));
to_x { col => 150, row => 31 } (list::nth (m, 4));
to_x { col => 150, row => 41 } (list::nth (m, 3));
to_x { col => 150, row => 51 } (list::nth (m, 2));
to_x { col => 150, row => 61 } (list::nth (m, 1));
to_x { col => 150, row => 71 } (list::nth (m, 0));
#
m = (list::tail m) @ [ list::head m ]; # Rotate the colors for visual interest.
};
# printf "guishim-imp-for-x.pkg sleeping for 2 seconds after doing 100 updates...\n";
# sleep_for 2.0;
};
};
end;