ELinks 0.18.0
terminal Struct Reference

This is one of the axis of ELinks' user interaction. More...

#include <terminal.h>

Collaboration diagram for terminal:

Public Member Functions

 LIST_HEAD_EL (struct terminal)
 

Data Fields

struct window list windows
 This is (at least partially) a stack of all the windows living in this terminal.
 
struct optionspec
 The specification of terminal in terms of terminal options.
 
char * title
 This is the terminal's current title, as perhaps displayed somewhere in the X window frame or so.
 
struct terminal_screenscreen
 This is the screen.
 
struct menumain_menu
 This is for displaying main menu.
 
int fdin
 These are pipes for communication with the ELinks instance owning this terminal.
 
int fdout
 
int blocked
 This indicates that the terminal is blocked, that is nothing should be drawn on it etc.
 
int width
 Terminal dimensions.
 
int height
 
enum term_redrawing_state redrawing
 Indicates whether we are currently in the process of redrawing the stuff being displayed on the terminal.
 
unsigned int master:1
 Indicates the master terminal, that is the terminal under supervision of the master ELinks instance (the one doing all the work and even maintaining these structures ;-).
 
unsigned int utf8_cp:1
 Indicates whether the charset of the terminal is UTF-8.
 
unsigned int utf8_io:1
 Indicates whether UTF-8 I/O is used.
 
int current_tab
 The current tab number.
 
term_env_type_T environment
 The type of environment this terminal lives in.
 
char cwd [MAX_CWD_LEN]
 The current working directory for this terminal / ELinks instance.
 
struct terminal_interlinkinterlink
 For communication between instances.
 
void * textarea_data
 
struct term_event_mouse prev_mouse_event
 
int cell_width
 
int cell_height
 
struct uriclosed_tab_uri
 

Detailed Description

This is one of the axis of ELinks' user interaction.

struct terminal defines the terminal ELinks is running on — each ELinks instance has one. It contains the basic terminal attributes, the settings associated with this terminal, screen content (and more abstract description of what is currently displayed on it) etc. It also maintains some runtime information about the actual ELinks instance owning this terminal.

Todo
TODO: Regroup the following into logical chunks. –pasky

Member Function Documentation

◆ LIST_HEAD_EL()

terminal::LIST_HEAD_EL ( struct terminal )

terminals is the sentinel.

Field Documentation

◆ blocked

int terminal::blocked

This indicates that the terminal is blocked, that is nothing should be drawn on it etc.

Typically an external program is running on it right now. This is a file descriptor.

◆ cell_height

int terminal::cell_height

◆ cell_width

int terminal::cell_width

◆ closed_tab_uri

struct uri* terminal::closed_tab_uri

◆ current_tab

int terminal::current_tab

The current tab number.

◆ cwd

char terminal::cwd[MAX_CWD_LEN]

The current working directory for this terminal / ELinks instance.

◆ environment

term_env_type_T terminal::environment

The type of environment this terminal lives in.

◆ fdin

int terminal::fdin

These are pipes for communication with the ELinks instance owning this terminal.

See also
struct itrm

◆ fdout

int terminal::fdout

◆ height

int terminal::height

◆ interlink

struct terminal_interlink* terminal::interlink

For communication between instances.

◆ main_menu

struct menu* terminal::main_menu

This is for displaying main menu.

◆ master

unsigned int terminal::master

Indicates the master terminal, that is the terminal under supervision of the master ELinks instance (the one doing all the work and even maintaining these structures ;-).

◆ prev_mouse_event

struct term_event_mouse terminal::prev_mouse_event

◆ redrawing

enum term_redrawing_state terminal::redrawing

Indicates whether we are currently in the process of redrawing the stuff being displayed on the terminal.

It is typically used to prevent redrawing inside of redrawing.

◆ screen

struct terminal_screen* terminal::screen

This is the screen.

See terminal/screen.h

◆ spec

struct option* terminal::spec

The specification of terminal in terms of terminal options.

◆ textarea_data

void* terminal::textarea_data

◆ title

char* terminal::title

This is the terminal's current title, as perhaps displayed somewhere in the X window frame or so.

◆ utf8_cp

unsigned int terminal::utf8_cp

Indicates whether the charset of the terminal is UTF-8.


◆ utf8_io

unsigned int terminal::utf8_io

Indicates whether UTF-8 I/O is used.

Forced on if the UTF-8 charset is selected. (bug 827)

◆ width

int terminal::width

Terminal dimensions.

◆ windows

struct window list terminal::windows

This is (at least partially) a stack of all the windows living in this terminal.

A window can be wide range of stuff, from a menu box through classical dialog window to a tab. See terminal/window.h for more on windows.

Tabs are special windows, though, and you never want to display them all, but only one of them. ALWAYS check inactive_tab() during iterations through this list (unless it is really useless or you are sure what are you doing) to make sure that you don't distribute events etc to inactive tabs.

The stack is top-down, thus .next is the stack's top, the current window; and .prev is the bottom, covered by others.

  • Dialogs or active menus are at the top.
  • Next come all tabs (window.type == WINDOW_TAB). The tab listed leftmost in the tab bar is at the top, and the tab listed rightmost is at the bottom; but current_tab controls which tab is actually displayed.
  • If the main menu is inactive, then it is at the very bottom, hidden under the tabs. Call assert_window_stacking() to verify this.

    Todo
    FIXME: Tabs violate the stack nature of this list, they appear there randomly but always in the order in which they were inserted there. Eventually, they should all live at the stack bottom, with the actual tab living on the VERY bottom. –pasky

    Keeping the current tab at the very bottom would require storing tab numbers explicitly, rather than computing them from the stack order as is done now. Also, what should be done with the inactive main menu? –KON


The documentation for this struct was generated from the following file: