Skip to content

Technical Documentation

Mogens Brødsgaard Lund edited this page Nov 18, 2016 · 9 revisions

This section contains documentation of the technical parts of Liquid. The target audience are developers who want to know how Liquid is designed in its engine. Maybe as inspiration for creating similar applications or to do advanced plugins.

Scratch! Not done yet.
My Diagram Image

Main loop

To understand the flow through the main loop, here is a detailed case of the actions called in-between a key press and the display update:

  1. USER: The user presses the "a" button.
  2. CORE: Liquid recieves the keycode 97
  3. CORE: 97 is translated to :a
  4. CORE: :a is sent to editor
  5. EDIT: editor finds mode from topmost buffer
  6. EDIT: editor gets function from map in mode with keyword :a and executes it, like
    • (editor/insert "a")
    • (editor/insert "a") calls (buffer/insert "a") on the topmost buffer
    • (buffer/insert "a") calls (slider/insert "a") on the associated slider which updates the data structure.
  7. CORE: windows and corresponding buffers are retrieved from editor
  8. CORE: windows and buffers are used to render sets of lines with formatting tags
  9. CORE: Formatted lines are translated to ui commands to be displayed on screen
  10. USER: The user sees "a" on the screen.

Data structures and transitions

Screen

Before:

(defn   

After:

(defn a

Slider

Before:

{:before '(" " "n" "f" "e" "d" "(") :after '()} 

After:

{:before '("a" " " "n" "f" "e" "d" "(") :after '()}

Rendered line

'("(" {:face :type1 :bgface :plain} "d" "e" "f" "n"
{:face :plain :bgface :plain} " "
{:face :type2 :bgface :plain} "a")

In the terminal case the formatting tags are translated into escape codes to change text colors.

A not yet finished task is to translate the rendered lines into html which might be used to display in a browser or a JTextEditor.

Clone this wiki locally