Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 The Chromium OS Authors. All rights reserved. |
| 3 | * Use of this source code is governed by a BSD-style license that can be |
| 4 | * found in the LICENSE file. |
| 5 | */ |
| 6 | |
| 7 | #ifndef TERM_H |
| 8 | #define TERM_H |
| 9 | |
David Sodman | f0a925a | 2015-05-04 11:19:19 -0700 | [diff] [blame] | 10 | #include "image.h" |
David Sodman | bbcb052 | 2014-09-19 10:34:07 -0700 | [diff] [blame] | 11 | #include "video.h" |
Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame] | 12 | |
Stéphane Marchesin | 08c08e7 | 2016-01-07 16:44:08 -0800 | [diff] [blame^] | 13 | #define MAX_STD_TERMINALS (3) |
| 14 | #define NUM_SPLASH_TERMINAL (1) |
| 15 | #define MAX_TERMINALS (MAX_STD_TERMINALS + NUM_SPLASH_TERMINAL) |
| 16 | #define SPLASH_TERMINAL (MAX_TERMINALS - 1) |
| 17 | |
David Sodman | f0a925a | 2015-05-04 11:19:19 -0700 | [diff] [blame] | 18 | typedef struct _terminal_t terminal_t; |
Stéphane Marchesin | 00ff187 | 2015-12-14 13:40:09 -0800 | [diff] [blame] | 19 | terminal_t* term_init(bool interactive, video_t* video); |
David Sodman | bbcb052 | 2014-09-19 10:34:07 -0700 | [diff] [blame] | 20 | void term_close(terminal_t* terminal); |
| 21 | void term_redraw(terminal_t* terminal); |
| 22 | void term_set_dbus(terminal_t* terminal, dbus_t* dbus); |
David Sodman | bbcb052 | 2014-09-19 10:34:07 -0700 | [diff] [blame] | 23 | void term_close(terminal_t* terminal); |
David Sodman | bf3f284 | 2014-11-12 08:26:58 -0800 | [diff] [blame] | 24 | void term_key_event(terminal_t* terminal, uint32_t keysym, int32_t unicode); |
| 25 | bool term_is_child_done(terminal_t* terminal); |
| 26 | |
| 27 | void term_page_up(terminal_t* terminal); |
| 28 | void term_page_down(terminal_t* terminal); |
| 29 | void term_line_up(terminal_t* terminal); |
| 30 | void term_line_down(terminal_t* terminal); |
| 31 | |
| 32 | bool term_is_valid(terminal_t* terminal); |
| 33 | int term_fd(terminal_t* terminal); |
| 34 | void term_dispatch_io(terminal_t* terminal, fd_set* read_set); |
| 35 | bool term_exception(terminal_t*, fd_set* exception_set); |
| 36 | bool term_is_active(terminal_t*); |
David Sodman | 8ef2006 | 2015-01-06 09:23:40 -0800 | [diff] [blame] | 37 | void term_activate(terminal_t*); |
David Sodman | f0a925a | 2015-05-04 11:19:19 -0700 | [diff] [blame] | 38 | void term_deactivate(terminal_t* terminal); |
David Sodman | bf3f284 | 2014-11-12 08:26:58 -0800 | [diff] [blame] | 39 | void term_add_fd(terminal_t* terminal, fd_set* read_set, fd_set* exception_set); |
David Sodman | 8ef2006 | 2015-01-06 09:23:40 -0800 | [diff] [blame] | 40 | const char* term_get_ptsname(terminal_t* terminal); |
David Sodman | f0a925a | 2015-05-04 11:19:19 -0700 | [diff] [blame] | 41 | void term_set_background(terminal_t* term, uint32_t bg); |
| 42 | int term_show_image(terminal_t* terminal, image_t* image); |
| 43 | void term_write_message(terminal_t* terminal, char* message); |
| 44 | void term_hide_cursor(terminal_t* terminal); |
| 45 | void term_show_cursor(terminal_t* terminal); |
David Sodman | 30a94ef | 2015-07-26 17:37:12 -0700 | [diff] [blame] | 46 | video_t* term_getvideo(terminal_t* terminal); |
Stéphane Marchesin | 08c08e7 | 2016-01-07 16:44:08 -0800 | [diff] [blame^] | 47 | terminal_t* term_get_terminal(int num); |
| 48 | void term_set_terminal(int num, terminal_t* terminal); |
Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame] | 49 | |
| 50 | #endif |