Replace old input subsystem with new uterm input
Use the new subsystem now throughout the whole code. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
1 parent
06885d2dd6
commit
199f4cbfa8
6 files changed
+22
-28
No files matched your search
+8
-9
@@ -41,7 +41,6 @@
|
||||
#include "eloop.h"
|
||||
#include "font.h"
|
||||
#include "gl.h"
|
||||
#include "input.h"
|
||||
#include "log.h"
|
||||
#include "pty.h"
|
||||
#include "terminal.h"
|
||||
@@ -64,7 +63,7 @@ struct kmscon_terminal {
|
||||
unsigned long ref;
|
||||
struct ev_eloop *eloop;
|
||||
struct uterm_video *video;
|
||||
struct kmscon_input *input;
|
||||
struct uterm_input *input;
|
||||
struct gl_shader *shader;
|
||||
bool opened;
|
||||
|
||||
@@ -237,8 +236,8 @@ static void video_event(struct uterm_video *video,
|
||||
rm_display(term, ev->display);
|
||||
}
|
||||
|
||||
static void input_event(struct kmscon_input *input,
|
||||
struct kmscon_input_event *ev,
|
||||
static void input_event(struct uterm_input *input,
|
||||
struct uterm_input_event *ev,
|
||||
void *data)
|
||||
{
|
||||
struct kmscon_terminal *term = data;
|
||||
@@ -263,7 +262,7 @@ static void input_event(struct kmscon_input *input,
|
||||
int kmscon_terminal_new(struct kmscon_terminal **out,
|
||||
struct ev_eloop *loop,
|
||||
struct uterm_video *video,
|
||||
struct kmscon_input *input)
|
||||
struct uterm_input *input)
|
||||
{
|
||||
struct kmscon_terminal *term;
|
||||
int ret;
|
||||
@@ -302,13 +301,13 @@ int kmscon_terminal_new(struct kmscon_terminal **out,
|
||||
if (ret)
|
||||
goto err_shader;
|
||||
|
||||
ret = kmscon_input_register_cb(term->input, input_event, term);
|
||||
ret = uterm_input_register_cb(term->input, input_event, term);
|
||||
if (ret)
|
||||
goto err_video;
|
||||
|
||||
ev_eloop_ref(term->eloop);
|
||||
uterm_video_ref(term->video);
|
||||
kmscon_input_ref(term->input);
|
||||
uterm_input_ref(term->input);
|
||||
*out = term;
|
||||
|
||||
log_debug("new terminal object %p", term);
|
||||
@@ -348,7 +347,7 @@ void kmscon_terminal_unref(struct kmscon_terminal *term)
|
||||
log_debug("free terminal object %p", term);
|
||||
kmscon_terminal_close(term);
|
||||
rm_all_screens(term);
|
||||
kmscon_input_unregister_cb(term->input, input_event, term);
|
||||
uterm_input_unregister_cb(term->input, input_event, term);
|
||||
uterm_video_unregister_cb(term->video, video_event, term);
|
||||
gl_shader_unref(term->shader);
|
||||
kmscon_pty_unref(term->pty);
|
||||
@@ -356,7 +355,7 @@ void kmscon_terminal_unref(struct kmscon_terminal *term)
|
||||
kmscon_console_unref(term->console);
|
||||
if (term->redraw)
|
||||
ev_eloop_unregister_idle_cb(term->eloop, draw_all, term);
|
||||
kmscon_input_unref(term->input);
|
||||
uterm_input_unref(term->input);
|
||||
uterm_video_unref(term->video);
|
||||
ev_eloop_unref(term->eloop);
|
||||
free(term);
|
||||
|
||||
+1
-2
@@ -37,7 +37,6 @@
|
||||
#include "console.h"
|
||||
#include "eloop.h"
|
||||
#include "gl.h"
|
||||
#include "input.h"
|
||||
#include "uterm.h"
|
||||
|
||||
struct kmscon_terminal;
|
||||
@@ -55,7 +54,7 @@ typedef void (*kmscon_terminal_event_cb)
|
||||
int kmscon_terminal_new(struct kmscon_terminal **out,
|
||||
struct ev_eloop *loop,
|
||||
struct uterm_video *video,
|
||||
struct kmscon_input *input);
|
||||
struct uterm_input *input);
|
||||
void kmscon_terminal_ref(struct kmscon_terminal *term);
|
||||
void kmscon_terminal_unref(struct kmscon_terminal *term);
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <string.h>
|
||||
#include "conf.h"
|
||||
#include "eloop.h"
|
||||
#include "input.h"
|
||||
#include "log.h"
|
||||
#include "terminal.h"
|
||||
#include "ui.h"
|
||||
@@ -44,7 +43,7 @@
|
||||
struct kmscon_ui {
|
||||
struct ev_eloop *eloop;
|
||||
struct uterm_video *video;
|
||||
struct kmscon_input *input;
|
||||
struct uterm_input *input;
|
||||
struct kmscon_terminal *term;
|
||||
};
|
||||
|
||||
@@ -68,8 +67,8 @@ static void video_event(struct uterm_video *video,
|
||||
}
|
||||
}
|
||||
|
||||
static void input_event(struct kmscon_input *input,
|
||||
struct kmscon_input_event *ev,
|
||||
static void input_event(struct uterm_input *input,
|
||||
struct uterm_input_event *ev,
|
||||
void *data)
|
||||
{
|
||||
}
|
||||
@@ -77,7 +76,7 @@ static void input_event(struct kmscon_input *input,
|
||||
int kmscon_ui_new(struct kmscon_ui **out,
|
||||
struct ev_eloop *eloop,
|
||||
struct uterm_video *video,
|
||||
struct kmscon_input *input)
|
||||
struct uterm_input *input)
|
||||
{
|
||||
struct kmscon_ui *ui;
|
||||
int ret;
|
||||
@@ -101,7 +100,7 @@ int kmscon_ui_new(struct kmscon_ui **out,
|
||||
if (ret)
|
||||
goto err_term;
|
||||
|
||||
ret = kmscon_input_register_cb(ui->input, input_event, ui);
|
||||
ret = uterm_input_register_cb(ui->input, input_event, ui);
|
||||
if (ret)
|
||||
goto err_video;
|
||||
|
||||
@@ -111,12 +110,12 @@ int kmscon_ui_new(struct kmscon_ui **out,
|
||||
|
||||
ev_eloop_ref(ui->eloop);
|
||||
uterm_video_ref(ui->video);
|
||||
kmscon_input_ref(ui->input);
|
||||
uterm_input_ref(ui->input);
|
||||
*out = ui;
|
||||
return 0;
|
||||
|
||||
err_input:
|
||||
kmscon_input_unregister_cb(ui->input, input_event, ui);
|
||||
uterm_input_unregister_cb(ui->input, input_event, ui);
|
||||
err_video:
|
||||
uterm_video_unregister_cb(ui->video, video_event, ui);
|
||||
err_term:
|
||||
@@ -131,10 +130,10 @@ void kmscon_ui_free(struct kmscon_ui *ui)
|
||||
if (!ui)
|
||||
return;
|
||||
|
||||
kmscon_input_unregister_cb(ui->input, input_event, ui);
|
||||
uterm_input_unregister_cb(ui->input, input_event, ui);
|
||||
uterm_video_unregister_cb(ui->video, video_event, ui);
|
||||
kmscon_terminal_unref(ui->term);
|
||||
kmscon_input_unref(ui->input);
|
||||
uterm_input_unref(ui->input);
|
||||
uterm_video_unref(ui->video);
|
||||
ev_eloop_unref(ui->eloop);
|
||||
free(ui);
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "eloop.h"
|
||||
#include "input.h"
|
||||
#include "uterm.h"
|
||||
|
||||
struct kmscon_ui;
|
||||
@@ -43,7 +42,7 @@ struct kmscon_ui;
|
||||
int kmscon_ui_new(struct kmscon_ui **out,
|
||||
struct ev_eloop *eloop,
|
||||
struct uterm_video *video,
|
||||
struct kmscon_input *input);
|
||||
struct uterm_input *input);
|
||||
void kmscon_ui_free(struct kmscon_ui *ui);
|
||||
|
||||
#endif /* KMSCON_UI_H */
|
||||
@@ -54,7 +54,6 @@
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#include "console.h"
|
||||
#include "input.h"
|
||||
#include "log.h"
|
||||
#include "unicode.h"
|
||||
#include "vte.h"
|
||||
@@ -873,7 +872,7 @@ void kmscon_vte_input(struct kmscon_vte *vte, const char *u8, size_t len)
|
||||
}
|
||||
|
||||
int kmscon_vte_handle_keyboard(struct kmscon_vte *vte,
|
||||
const struct kmscon_input_event *ev, const char **u8, size_t *len)
|
||||
const struct uterm_input_event *ev, const char **u8, size_t *len)
|
||||
{
|
||||
kmscon_symbol_t sym;
|
||||
|
||||
@@ -920,7 +919,7 @@ int kmscon_vte_handle_keyboard(struct kmscon_vte *vte,
|
||||
return KMSCON_VTE_SEND;
|
||||
}
|
||||
|
||||
if (ev->unicode != KMSCON_INPUT_INVALID) {
|
||||
if (ev->unicode != UTERM_INPUT_INVALID) {
|
||||
kmscon_symbol_free_u8(vte->kbd_sym);
|
||||
sym = kmscon_symbol_make(ev->unicode);
|
||||
vte->kbd_sym = kmscon_symbol_get_u8(sym, len);
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "console.h"
|
||||
#include "input.h"
|
||||
#include "unicode.h"
|
||||
|
||||
struct kmscon_vte;
|
||||
@@ -52,6 +51,6 @@ void kmscon_vte_unref(struct kmscon_vte *vte);
|
||||
void kmscon_vte_bind(struct kmscon_vte *vte, struct kmscon_console *con);
|
||||
void kmscon_vte_input(struct kmscon_vte *vte, const char *u8, size_t len);
|
||||
int kmscon_vte_handle_keyboard(struct kmscon_vte *vte,
|
||||
const struct kmscon_input_event *ev, const char **u8, size_t *len);
|
||||
const struct uterm_input_event *ev, const char **u8, size_t *len);
|
||||
|
||||
#endif /* KMSCON_VTE_H */
|
||||
Reference in new issue
Block a user