terminal: remove global video object
We used to have a global video object for each terminal. However, this has all been moved to the UI subsystem which can deal with multiple video objects simultaneously. Hence, we can remove this as it is no longer used. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
bed915dfb6
commit
11a4b6c887
@ -58,7 +58,6 @@ struct screen {
|
|||||||
struct kmscon_terminal {
|
struct kmscon_terminal {
|
||||||
unsigned long ref;
|
unsigned long ref;
|
||||||
struct ev_eloop *eloop;
|
struct ev_eloop *eloop;
|
||||||
struct uterm_video *video;
|
|
||||||
struct uterm_input *input;
|
struct uterm_input *input;
|
||||||
bool opened;
|
bool opened;
|
||||||
|
|
||||||
@ -319,13 +318,12 @@ static void write_event(struct kmscon_vte *vte, const char *u8, size_t len,
|
|||||||
|
|
||||||
int kmscon_terminal_new(struct kmscon_terminal **out,
|
int kmscon_terminal_new(struct kmscon_terminal **out,
|
||||||
struct ev_eloop *loop,
|
struct ev_eloop *loop,
|
||||||
struct uterm_video *video,
|
|
||||||
struct uterm_input *input)
|
struct uterm_input *input)
|
||||||
{
|
{
|
||||||
struct kmscon_terminal *term;
|
struct kmscon_terminal *term;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!out || !loop || !video || !input)
|
if (!out || !loop || !input)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
term = malloc(sizeof(*term));
|
term = malloc(sizeof(*term));
|
||||||
@ -335,7 +333,6 @@ int kmscon_terminal_new(struct kmscon_terminal **out,
|
|||||||
memset(term, 0, sizeof(*term));
|
memset(term, 0, sizeof(*term));
|
||||||
term->ref = 1;
|
term->ref = 1;
|
||||||
term->eloop = loop;
|
term->eloop = loop;
|
||||||
term->video = video;
|
|
||||||
term->input = input;
|
term->input = input;
|
||||||
kmscon_dlist_init(&term->screens);
|
kmscon_dlist_init(&term->screens);
|
||||||
|
|
||||||
@ -356,7 +353,6 @@ int kmscon_terminal_new(struct kmscon_terminal **out,
|
|||||||
goto err_pty;
|
goto err_pty;
|
||||||
|
|
||||||
ev_eloop_ref(term->eloop);
|
ev_eloop_ref(term->eloop);
|
||||||
uterm_video_ref(term->video);
|
|
||||||
uterm_input_ref(term->input);
|
uterm_input_ref(term->input);
|
||||||
*out = term;
|
*out = term;
|
||||||
|
|
||||||
@ -400,7 +396,6 @@ void kmscon_terminal_unref(struct kmscon_terminal *term)
|
|||||||
if (term->redraw)
|
if (term->redraw)
|
||||||
ev_eloop_unregister_idle_cb(term->eloop, draw_all, term);
|
ev_eloop_unregister_idle_cb(term->eloop, draw_all, term);
|
||||||
uterm_input_unref(term->input);
|
uterm_input_unref(term->input);
|
||||||
uterm_video_unref(term->video);
|
|
||||||
ev_eloop_unref(term->eloop);
|
ev_eloop_unref(term->eloop);
|
||||||
free(term);
|
free(term);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,6 @@ typedef void (*kmscon_terminal_event_cb)
|
|||||||
|
|
||||||
int kmscon_terminal_new(struct kmscon_terminal **out,
|
int kmscon_terminal_new(struct kmscon_terminal **out,
|
||||||
struct ev_eloop *loop,
|
struct ev_eloop *loop,
|
||||||
struct uterm_video *video,
|
|
||||||
struct uterm_input *input);
|
struct uterm_input *input);
|
||||||
void kmscon_terminal_ref(struct kmscon_terminal *term);
|
void kmscon_terminal_ref(struct kmscon_terminal *term);
|
||||||
void kmscon_terminal_unref(struct kmscon_terminal *term);
|
void kmscon_terminal_unref(struct kmscon_terminal *term);
|
||||||
|
2
src/ui.c
2
src/ui.c
@ -182,7 +182,7 @@ int kmscon_ui_new(struct kmscon_ui **out,
|
|||||||
ui->input = input;
|
ui->input = input;
|
||||||
kmscon_dlist_init(&ui->video_list);
|
kmscon_dlist_init(&ui->video_list);
|
||||||
|
|
||||||
ret = kmscon_terminal_new(&ui->term, eloop, video, ui->input);
|
ret = kmscon_terminal_new(&ui->term, eloop, ui->input);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_free;
|
goto err_free;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user