Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/jrincayc/ucblogo-code
26 January 2024, 08:32:20 UTC
  • Code
  • Branches (8)
  • Releases (24)
  • Visits
Revision 8d03f497146e641d7c3785ab2562b5148584fb3d authored by Joshua Cogliati on 22 November 2020, 22:08:40 UTC, committed by GitHub on 22 November 2020, 22:08:40 UTC
Merge pull request #64 from dmalec/ISSUE-63
ISSUE-63: Exit getFromWX_2 input loop on pause character sequence.
2 parent s a7bd4e1 + 4aa84f2
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/heads/debug_stop
    • refs/heads/fix_39
    • refs/heads/makefile_updates_v2
    • refs/heads/master
    • refs/heads/message_fix
    • refs/heads/release_624_changes
    • refs/heads/utf8_play
    • refs/tags/dev-latest
    • 8d03f497146e641d7c3785ab2562b5148584fb3d
    • version_6.2.5rc1
    • version_6.2.4rc1
    • version_6.2.4
    • version_6.2.3rc1
    • version_6.2.3
    • version_6.2.2
    • version_6.2.1
    • version_6.2
    • version_6.1
    • version_6.0
    • pre_release_6_2_b
    • pre_release_6_2_a
    • pre_release_6_2_2
    • pre_release_6_1_c
    • pre_release_6_1_b
    • pre_release_6_1_a
    • last_svn_version
    • debian/6.2.4-1
    • debian/6.2.3-1
    • debian/6.2.2-3
    • debian/6.2.2-2
    • debian/6.2.2-1
    • debian/6.2.1-2
    • debian/6.2.1-1
  • d96b992
  • /
  • newtermnotes
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:8d03f497146e641d7c3785ab2562b5148584fb3d
origin badgedirectory badge
swh:1:dir:d96b9928ef893466ad4079ec4316955146303f57
origin badgecontent badge
swh:1:cnt:a020dcf24b70198a01175cd18f5a3876f9d96416
origin badgesnapshot badge
swh:1:snp:6eedb1da19a602bcc290a95dfe80bedb7646053c

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 8d03f497146e641d7c3785ab2562b5148584fb3d authored by Joshua Cogliati on 22 November 2020, 22:08:40 UTC
Merge pull request #64 from dmalec/ISSUE-63
Tip revision: 8d03f49
newtermnotes

How the GUI communicates with Logo in wxWidgets:


Everything is done with a single thread. We have overriden the 
main event loop from wxWidgets (via LogoApplication::OnRun()),
and events are handled periodically through calls to 
check_wx_stop(), which calls LogoEventManager::ProcessEvents().
To prevent yielding too much time for event checking, we have a
"fudge factor" that delays how often we yield to the wxWidgets
GUI event checking code, and a parameter that let's us force
yielding if we are say polling for user input. All events (key
press events, window resize, etc) are handled during the yield.
There is a trade-off between responsiveness in the UI (how fast 
the GUI recognizes that a key has been pressed) and overall speed 
of the program (when crunching numbers or painting) when adjusting
the fudge factor.


Character buffers

in wxTerminal:  
 char input_buffer[MAXINBUFF];   //stores typed input (before send to logo)

in wxMain:
 char output_buffer[MAXOUTBUFF]; //stores output to send to terminal (from logo)
 char buff[BUFF_LEN];            //stores input to send to logo (from input_buffer)

When polling for input, any typed characters are stored in input_buffer, which
keeps track of total characters and where the cursor position is (because you can
use the left and right arrow keys to go back). 
When the enter key is pressed, one line is put into the logo buffer (buff) and
will be read from logo.
Whenever logo needs to print characters to screen, the characters are put in 
output_buffer and will be displayed by the GUI.


Terminal Display Character Storage

The contents of the terminal are stored in a linked list of character arrays.
There are two structures, one that stores the actual characters and mode flags
(bold, standout mode, etc), and one that stores line information (where each
line starts). Both are linked lists of blocks. 

struct wxterm_char_buffer {
  unsigned char cbuf[WXTERM_CB_SIZE];       //characters
  unsigned char mbuf[WXTERM_CB_SIZE];       //mode flags
  wxterm_char_buffer *next; //next part of buffer
} ;

struct wxterm_charpos {
  wxterm_char_buffer *buf;   //which char buffer
  int offset;                //offset into buffer
  int line_length;           //length of line
} ;

A charpos points to some character in the character buffer. There are macros
to help navigate. (line_length may or may not be used, depending on the situation).


char_of(charpos)        retrieves the character referenced by charpos
mode_of(charpos)        retrieves the mode of the character referenced by charpos
inc_charpos(charpos)    puts charpos to next character 
		        (goes to next block if necessary)
adjust_charpos(charpos) if offset too large, adjusts charpos so that it points to 
                    	the right block (commonly used to jump many characters 
    			forward)



struct wxterm_line_buffer {
  wxterm_charpos lbuf[WXTERM_LB_SIZE];  //lines
  wxterm_line_buffer *next;          //next part of buffer
};

struct wxterm_linepos {
  wxterm_line_buffer *buf;  //which line buffer
  int offset;               //offset into line buffer
};



A linepos references a particular line. A line is just a charpos, keeping track of
where the start of the line is, and how long the line is. There are macros to help
navigate this structure as well:

line_of(linepos)        gets line referenced by linepos.
inc_linepos(linepos)    puts linepos to next line
adjust_linepos(linepos) if offset is too large, adjusts linepos so it points to the
			right block.

So, our terminal references the start of the character buffer / line buffer with

  wxterm_char_buffer *term_chars;
  wxterm_line_buffer *term_lines;

and references the current position (where the cursor is) with 

  wxterm_charpos curr_char_pos;
  wxterm_linepos curr_line_pos;

With this, it's easy to retrieve a particular line:

wxterm_linepos wxTerminal::GetLinePosition(int y) 
{
  wxterm_linepos lpos;
  lpos.buf = term_lines;
  lpos.offset = y;
  adjust_linepos(lpos);
  return lpos;
}

Set the offset and adjust the position!


DebugOutputBuffer() can be called to print out the contents 
and properties of the terminal.

The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API