modus
Menu
On this page

The module interface_module

The interface package as a module (the test of the claim "the functions are written so the package can become a module later with the same calls"). Each export calls one function of src/library/modus/interface over two tables in memory of the caller: the draw table (Table of Draw_Record, Append) and the text table (Bytes, Append). The module holds no state of the process: a frame of the package is made over the two tables for the time of one call.

What it is for. It checks a claim of the interface package by doing it: the same functions, called through the call form, give the same draw records as a call of the package in the process. The process interface_through_module loads it, draws its window through it, and compares the records and the time of each way.

The rule of the results of each export that appends: the result is the count of draw records of the whole answer. A result larger than the capacity of the table says that the answer did not fit, and the caller gives a larger table. The result is -1 with an error record for a table over 2^40 records or bytes, or for one element over 64 records or 4096 bytes of text.

What it does not hold: the damage of a frame and the draw of its records into pixels. They are the two exports of the drawing module (src/modules/libraries/drawing), which each module with a window imports. This module keeps the elements only: it shows what one element call through a border costs, and why the elements stay compiled into each module.

See: The interface of the processes: Where it lives: the elements in each process, the drawing in a module

interface_module module with no entry

Hash
7466d57a456348fc7e014e874c29c71a296ff96968ae4cbf6b13bcbe707f4a8c
Size
69632 bytes
Exports
6
Imports
0
Imported by
1
License
MIT

The interface package as a module (the test of the claim "the functions are written so the package can become a module later with the same calls")

FactValue
KindModules with no entry
Sourcesrc/modules/libraries/interface_module
Boot imageyes: in the boot image, 69632 bytes in this build
Build settingsnone: the defaults of the source
Importsnone
Imported by

Neighbours

What it imports, at its left, and what imports it, at its right: the part of the module graph that touches it.

interface_module interface_through_module

Exports

ExportWhat it does
draw_background(drawn: Table(Draw_Record, Append), area: Area) -> Integerappends the background of the rules on an area: one color and the grid of points
draw_card(drawn: Table(Draw_Record, Append), text: Bytes(Append), area: Table(Area, Change), title: Text, caption: Text, accent: Integer) -> Integerappends the frame of one subject: its border, its surface, its title in the accent and its caption
draw_cell_text(drawn: Table(Draw_Record, Append), text: Bytes(Append), cell: Area, words: Text, color: Integer, right: Integer) -> Integerappends a text in a cell of a line, at the left, or at the right when right is not 0
draw_label_value_line(drawn: Table(Draw_Record, Append), text: Bytes(Append), line: Label_Value, label: Text, value: Text) -> Integerappends a name in the dim color and its value
draw_table_band(drawn: Table(Draw_Record, Append), area: Area, index: Integer) -> Integerappends the band under line index of a table: every second line has the surface of a card
draw_bar(drawn: Table(Draw_Record, Append), bar: Bar_Value) -> Integerappends a value against a maximum: the track and the full part

draw_background

draw_background(drawn: (, Append), area: ) -> 

draw_background appends the background of the rules on an area: one color and the grid of points. The result is the count of draw records of the full answer (larger than the capacity: it did not fit), or -1 with an error record: Too_Long for a table over 2^40 records or bytes, Full for an element over 64 records or 4096 bytes of text, Out_Of_Range for a text table past 2^32 bytes.

Parameters
  • drawn: (, Append)
  • area:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/interface_module/interface_module.odin:262

draw_card

draw_card(drawn: (, Append), text: (Append), area: (, Change), title: , caption: , accent: ) -> 

draw_card appends the frame of one subject: its border, its surface, its title in the accent and its caption. It writes the area of its content in the one row of area. The result is the count of draw records of the full answer (larger than the capacity: it did not fit), or -1 with an error record: Too_Long for a table over 2^40 records or bytes, Full for an element over 64 records or 4096 bytes of text, Out_Of_Range for a text table past 2^32 bytes.

Parameters
  • drawn: (, Append)
  • text: (Append)
  • area: (, Change)
  • title:
  • caption:
  • accent:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/interface_module/interface_module.odin:273

draw_cell_text

draw_cell_text(drawn: (, Append), text: (Append), cell: , words: , color: , right: ) -> 

draw_cell_text appends a text in a cell of a line, at the left, or at the right when right is not 0. The result is the count of draw records of the full answer (larger than the capacity: it did not fit), or -1 with an error record: Too_Long for a table over 2^40 records or bytes, Full for an element over 64 records or 4096 bytes of text, Out_Of_Range for a text table past 2^32 bytes.

Parameters
  • drawn: (, Append)
  • text: (Append)
  • cell:
  • words:
  • color:
  • right:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/interface_module/interface_module.odin:288

draw_label_value_line

draw_label_value_line(drawn: (, Append), text: (Append), line: , label: , value: ) -> 

draw_label_value_line appends a name in the dim color and its value. The result is the count of draw records of the full answer (larger than the capacity: it did not fit), or -1 with an error record: Too_Long for a table over 2^40 records or bytes, Full for an element over 64 records or 4096 bytes of text, Out_Of_Range for a text table past 2^32 bytes.

Parameters
  • drawn: (, Append)
  • text: (Append)
  • line:
  • label:
  • value:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/interface_module/interface_module.odin:299

draw_table_band

draw_table_band(drawn: (, Append), area: , index: ) -> 

draw_table_band appends the band under line index of a table: every second line has the surface of a card. The result is the count of draw records of the full answer (larger than the capacity: it did not fit), or -1 with an error record: Too_Long for a table over 2^40 records or bytes, Full for an element over 64 records or 4096 bytes of text, Out_Of_Range for a text table past 2^32 bytes.

Parameters
  • drawn: (, Append)
  • area:
  • index:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/interface_module/interface_module.odin:310

draw_bar

draw_bar(drawn: (, Append), bar: ) -> 

draw_bar appends a value against a maximum: the track and the full part. The result is the count of draw records of the full answer (larger than the capacity: it did not fit), or -1 with an error record: Too_Long for a table over 2^40 records or bytes, Full for an element over 64 records or 4096 bytes of text, Out_Of_Range for a text table past 2^32 bytes.

Parameters
  • drawn: (, Append)
  • bar:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/interface_module/interface_module.odin:321

Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).

Table wire form

A wire form of the module contract: one word of a call. Records of one description that follow each other (a table).

Draw_Record record of a module

A record of the module interface_module: 48 bytes, aligned on 4 bytes, 0 bytes of padding.

  • kindu801 bytes
  • reservedText(3)13 bytes
  • elementu3244 bytes
  • lefti3284 bytes
  • topi32124 bytes
  • righti32164 bytes
  • bottomi32204 bytes
  • fieldsText(24)2424 bytes

Area record of a module

A record of the module interface_module: 32 bytes, aligned on 8 bytes, 0 bytes of padding.

  • xi6408 bytes
  • yi6488 bytes
  • widthi64168 bytes
  • heighti64248 bytes

Integer wire form

A wire form of the module contract: one word of a call. A signed integer of 64 bits, in a register.

Error_Record record of a module

A record of the module interface_module: 56 bytes, aligned on 8 bytes, 0 bytes of padding.

  • kindi6408 bytes
  • uniti6488 bytes
  • operationi64168 bytes
  • argumenti64248 bytes
  • valuei64328 bytes
  • limiti64408 bytes
  • foundi64488 bytes

Bytes wire form

A wire form of the module contract: one word of a call. Bytes with no description.

Text wire form

A wire form of the module contract: one word of a call. The address of a slice record {address, count} of UTF-8 bytes.

Label_Value record of a module

A record of the module interface_module: 48 bytes, aligned on 8 bytes, 0 bytes of padding.

  • xi6408 bytes
  • yi6488 bytes
  • widthi64168 bytes
  • heighti64248 bytes
  • value_xi64328 bytes
  • colori64408 bytes

Bar_Value record of a module

A record of the module interface_module: 56 bytes, aligned on 8 bytes, 0 bytes of padding.

  • xi6408 bytes
  • yi6488 bytes
  • widthi64168 bytes
  • heighti64248 bytes
  • valuei64328 bytes
  • maximumi64408 bytes
  • colori64488 bytes